Inexplicable behaviour of <type 'function'>

Fabiano Sidler fabianosidler at gmail.com
Sun Apr 23 06:03:59 EDT 2006


Have a look to the following lines of code:
--- snip ---
class Foo: pass
def bar(): pass
Foo.bar = bar
--- snap ---

Why does 'bar.__get__(Foo) is Foo.bar' evaluate to False here? Did I
misunderstand the descriptor protocol?

Thank you for answering,
F. Sidler



More information about the Python-list mailing list