How to replace a method in an instance.
bruno.42.desthuilliers at wtf.websiteburo.oops.com
Mon Aug 27 09:53:27 CEST 2007
kyosohma at gmail.com a écrit :
> On Aug 22, 12:48 am, Bruno Desthuilliers
> <bdesth.quelquech... at free.quelquepart.fr> wrote:
>> kyoso... at gmail.com a écrit :
>>> Of course, a function in a
>>> class is also know as a method.
>> Less obvious but still wrong !-)
> I wish the authors of the Python books would get a clue then.
I'd think that at least some authors of some Python books would explain
all this much better than I did. But FWIW, all these rules are clearly
documented in the Fine Manual.
> I'm not going to help with these class / instance / whatever any more
> and leave it to all you professionals.
How do you think I learned ? One of the big things with usenet is that
you get a chance to be corrected when you're wrong, and I personnally
owe a lot of thanks to all the people that corrected me so far and still
> Yes, it you can use self in an outside method, but the way the OP
> asked the question and the nature of the traceback pointed to it just
> being a normal function,
Indeed, Steve's problem was that the function he attached to his
instance was *not* wrapped into a method object.
More information about the Python-list