Re: Unexpected result when comparing method with variable

2005-04-04 Thread David Handy
On Tue, Apr 05, 2005 at 03:38:09PM +1200, Tony Meyer wrote: > [David Handy] > > I had a program fail on me today because the following didn't > > work as I expected: > > > > >>> class C: > > ... def f(self): > > ... pass >

Unexpected result when comparing method with variable

2005-04-04 Thread David Handy
I had a program fail on me today because the following didn't work as I expected: >>> class C: ... def f(self): ... pass ... >>> c = C() >>> m = c.f >>> m is c.f False I would have expected that if I set a variable equal to a bound method, that variable, for all intents and purposes,