Skip to content

Instantly share code, notes, and snippets.

@mahmoudimus
Created August 30, 2012 00:07
Show Gist options
  • Save mahmoudimus/3520766 to your computer and use it in GitHub Desktop.
Save mahmoudimus/3520766 to your computer and use it in GitHub Desktop.
__self__ when bound
>>> 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