Created
May 25, 2014 13:34
-
-
Save ThiefMaster/3c101347fd6267b5ca09 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
>>> class Foo(object): | |
... def bar(self, blah): | |
... print self, blah | |
... | |
>>> Foo.bar | |
<unbound method Foo.bar> | |
>>> Foo.bar(None, 2) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: unbound method bar() must be called with Foo instance as first argument (got NoneType instance instead) | |
>>> Foo.bar(Foo(), 2) | |
<__main__.Foo object at 0x1f7d2d0> 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment