Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Something:
- @property
- def radius(self):
- return self.__radius
- @radius.setter
- def radius2(self, radius):
- self.__radius = radius
- s = Something()
- s.radius2 = 4
- print(s.radius2) # 4
- print(s.radius) # 4
- s.radius = 7 # AttributeError: can't set attribute
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement