Source Code:
(back to article)
class MyClass: def __init__(self): self._x = None @property def x(self): """I am the 'x' property.""" return self._x @x.setter def x(self, value): self._x = value a = MyClass() a.x = 10 print(a.x)
Result:
Report an issue