Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo:
- el = 'el'
- def __init__(self):
- pass
- class Bar(Foo):
- newel = []
- def __init__(self):
- pass
- f = Foo()
- b = Bar()
- d = Bar()
- b.newel.append(1)
- b.newel.append(2)
- print b.newel #[1, 2], OK
- print d.newel #[1, 2], WTF?!
- print f.newel #raises error: OK
Add Comment
Please, Sign In to add comment