I'm also not a php developer, but I agree. This seems like a huge footgun.
I've never been a fan of this kind of magic, and I wonder how other languages deal with this case.
I've never been a fan of this kind of magic, and I wonder how other languages deal with this case.
self.__dict__['property_name']
And if those PHP rules were in python you could just write: @property
def property_name(self):
return self.property_name
In actual python though, that would infinitely recurse.var milliseconds: int = 0
var seconds: int:
get:
return milliseconds / 1000
set(value):
milliseconds = value * 1000