Erik Max Francis a écrit : > Dave Kuhlman wrote: > >> Basically, the above code is saying that foo.foobar is not the same as >> getattr(foo, 'foobar'). > > Python promises that the behavior is the same. It does not promise that > the _objects_ will be the same, which is what `is` determines. That is, > you're not doing a useful test here.
FWIW, two methods are "the same" if they have identical (function, obj, cls) attributes. Looks like the equality test is correctly implemented: >>> foo.bar == foo.bar True HTH -- http://mail.python.org/mailman/listinfo/python-list