I have the following in Python 2.7:
class MyClass(object):
...
@property
def my_attr(self):
...
@my_attr.setter
def my_attr(self, value):
...
I use getter/setter so that I can do some logic in there.
Then I can call:
import myModule
test = myModule.MyClass()
test.my_attr = 9
I would like to use an alias at the module level so that I can do something like that:
import myModule
myModule.my_attr = 9
Is there a way to do that?