Created
October 22, 2013 21:44
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
In [1]: class Foo(object): | |
...: pass | |
...: | |
In [2]: def bar(self): | |
...: pass | |
...: | |
In [3]: bar.__get__ | |
Out[3]: <method-wrapper '__get__' of function object at 0x10fdc6398> | |
In [4]: bar | |
Out[4]: <function __main__.bar> | |
In [5]: Foo.bar = bar | |
In [6]: Foo.bar.__get__ | |
Out[6]: <method-wrapper '__get__' of instancemethod object at 0x10f8ef870> | |
In [7]: Foo.bar | |
Out[7]: <unbound method Foo.bar> | |
In [8]: f = Foo() | |
In [9]: f.bar.__get__ | |
Out[9]: <method-wrapper '__get__' of instancemethod object at 0x10f8ef820> | |
In [10]: f.bar | |
Out[10]: <bound method Foo.bar of <__main__.Foo object at 0x10fdc7250>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment