5 ms·
Python has a solution to this. There are decorators that allow you to access methods as if they are properties: class Foo(object): def __init__(sel
by bcj 12y ago
Python has a solution to this. There are decorators that allow you to access methods as if they are properties:
class Foo(object):
def __init__(self, bar):
self._bar = bar
@property
def bar(self):
return self._bar
@bar.setter
def bar(self, value):
self._bar = value
- illumen 12y agoAs does Objective-C, and JavaScript.