In [2]:
class A(object):
def __init__(self):
self._size = 0
@property
def size(self):
print("getting the property")
return self._size
@size.setter
def size(self, value):
print("setting the property")
self._size = value
a = A()
print(a.size)
a.size = 20
print(a.size)