Created
February 4, 2015 15:48
-
-
Save eternalruler/2008786d41733dd7bae2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ezimmerman@qdidev:~$ cat test.py | |
class FooBar(object): | |
derp = 0 | |
baz = 0 | |
def __init__(self): | |
FooBar.derp += 1 | |
self.derp += 1 | |
self.baz += 1 | |
print 'DERP', FooBar.derp, self.derp, self.baz | |
f1 = FooBar() | |
f2 = FooBar() | |
f3 = FooBar() | |
f4 = FooBar() | |
ezimmerman@qdidev:~$ python test.py | |
DERP 1 2 1 | |
DERP 2 3 1 | |
DERP 3 4 1 | |
DERP 4 5 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment