Method / Functions - What are the differences?
bruno.42.desthuilliers at websiteburo.invalid
Tue Mar 2 09:57:52 CET 2010
John Posner a écrit :
> On 3/1/2010 2:59 PM, Bruno Desthuilliers wrote:
>> Answer here:
>> I really have to put this in the wiki :-/
> Bruno, I performed a light copy-edit of your writeup and put in some
> reStructuredText (reST) markup. The result is at:
> The only sentence that I think needs work is:
> Having access to itself (of course), the
> instance (if there's one) and the class, it's easy for it
> to wrap all this into a **method** object.
> Maybe this?
> With the instance object (if any) and class object available,
> it's easy to create a method object that wraps the function object.
But there's also a typo to fix in the Python implementation of the
Method object: in the call method, it should inject self.im_self as
first arg, not self.im_func. This had been spotted by someone named John
Posner, IIRC !-)
> Begging pardon for my presumptuousness,
Begging pardon for my laziness :-/
More information about the Python-list