David Handy wrote:
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
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
> > ...
> > >>> c = C()
> > >>> m = c.f
> > >>> m is c.f
> > Fal
On Mon, 4 Apr 2005 23:34:41 -0400, David Handy
<[EMAIL PROTECTED]> wrote:
I'm not sure if this is the best way. But it might work.
for method, params in deferred:
method(*params)
try:
if method.im_func is c.f.im_func:
# handle a special case
except:
if
David Handy wrote:
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
[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
[...]
> The workaround really awkward:
What's wrong with this?
>>> class C:
...