Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class OneDigitNumericValue():
- def __init__(self, name):
- self.name = name
- def __get__(self, instance, owner):
- if instance is None:
- return self
- return instance.__dict__[self.name]
- def __set__(self, instance, value):
- instance.__dict__[self.name] = value
- class A:
- name = OneDigitNumericValue("name")
- class OneDigitNumericValue():
- def __get__(self, instance, owner):
- if instance is None:
- return self
- return instance.__dict__[self]
- def __set__(self, instance, value):
- instance.__dict__[self] = value
- class A:
- name = OneDigitNumericValue()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement