Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class KlassA(object):
- def __set__(self, instance, value):
- print 'Setting value'
- self.value = value
- class KlassB(object):
- a = KlassA()
- def __init__(self):
- print 'Working'
- class KlassC(object):
- def __init__(self):
- self.a = KlassA()
- print 'Not working'
- b = KlassB()
- b.a = 'hej'
- print type(b.a)
- print b.a.value
- c = KlassC()
- c.a = 'hejsan'
- print type(c.a)
- print c.a.value
Add Comment
Please, Sign In to add comment