Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- class A:
- x = []
- def add(self):
- self.x.append(1)
- class B:
- def __init__(self):
- self.x = []
- def add(self):
- self.x.append(1)
- x = A()
- y = A()
- x.add()
- y.add()
- print "A's x:",x.x
- x = B()
- y = B()
- x.add()
- y.add()
- print "B's x:",x.x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement