The setter and getter functions for built-in objects don't work as I would expect. According to the docs the setter for position is
the following code:
self.position = Vector2(1, 1)
# prints (1, 1)
position = Vector2(0, 0)
prints (1, 1) as an output, while I would have expected (0, 0). Compare the above code to
var my_pos: Vector2 setget set_my_pos
self.my_pos = Vector2(1, 1)
# prints (0, 0)
my_pos = Vector2(0, 0)
It seems in the built-in case the setter is not ever called when making the assignment, even when accessed externally. In other experiments, I had similar results for the built-in getter functions.
Obviously this isn't too hard to work around, but it is a bit confusing. Could someone please help me understand what's going on?