Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> class Me (Thread):
- ... def __init__ (self):
- ... Thread.__init__ (self)
- ... self.x = 0
- ... self.target = self.foo
- ... self.start ()
- ... def foo (self):
- ... while True:
- ... self.x += 1
- ...
- >>> class Me2 (Thread):
- ... def __init__ (self):
- ... Thread.__init__ (self)
- ... self.target = self.foo
- ... self.start ()
- ... def foo (self):
- ... global x
- ... while True:
- ... x += 1
- ...
- >>> x = 0
- >>> me = Me ()
- >>> me.x
- 0
- >>> del me
- >>> me2 = Me2 ()
- >>> x
- 16112383850
- >>> x
- 16120480574
Add Comment
Please, Sign In to add comment