Created
August 30, 2012 00:07
-
-
Save mahmoudimus/3520766 to your computer and use it in GitHub Desktop.
__self__ when bound
This file contains hidden or 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 O(object): | |
... def foo(self): | |
... return 1 | |
... | |
>>> o = O() | |
>>> o.foo | |
<bound method O.foo of <__main__.O object at 0x10049a910>> | |
>>> o.foo.__self__ | |
<__main__.O object at 0x10049a910> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment