Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class P:
- @property
- def z(self): return 42
- @z.setter
- def z(self, value): print(value)
- class PD(P): pass
- p = PD()
- super(PD, p).z
- # prints 42
- super(PD, p).z = 21
- # Traceback (most recent call last):
- # File "<stdin>", line 1, in <module>
- # AttributeError: 'super' object has no attribute 'z'
- super(PD, p).z(21)
- # Traceback (most recent call last):
- # File "<stdin>", line 1, in <module>
- # TypeError: 'int' object is not callable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement