can i do operator overloading in gdscript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Thakee Nathees

i’m trying to iterate an inner class , and i want to know any methods to do so,
( like _ _ iter _ _() method in python ) and for operator overloading

class inner:
    var arr = [ 1, 2, 3, 4, 5 ]
    func _iterate():
        return self.arr._iterate()



func _ready():
    var instance = inner.new()
    for i in instance:
        print(i)
:bust_in_silhouette: Reply From: Xrayez

There’s a doc section on implementing custom iterators in GDScript.
I haven’t tried it but looks like it’s similar to how Python does it.