Created
January 7, 2016 16:09
-
-
Save rdammkoehler/4c68d2a1ba13be4caa00 to your computer and use it in GitHub Desktop.
Don't do this
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
class Foo(object): | |
@classmethod | |
def bar(cls,x): | |
cls.x = x | |
def p(self): | |
print self.x | |
a = Foo() | |
a.bar(1) | |
a.p() # 1 | |
b = Foo() | |
b.bar(2) | |
b.p() # 2 | |
a.p() # 2, not what we wanted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment