On Thu, Aug 6, 2020 at 6:16 PM email@example.com wrote:
I think a property decorator can be useful, because you consider the simplest case with:
class MyClass: @my_property name = arg
but consider it can generate the following code:
class MyClass: def name(self): ... def see_name(self): ...
Hmmm. I don't really like it, but worst case, you can do this with __set_name__ and mutating the target class. You wouldn't decorate it, just assign a my_property object to the name you want.
Alternatively, decorate the class itself with something that does whatever changes you want.