the address of list.append and list.append.__doc__

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Sep 26 09:54:51 CEST 2007


HYRY a écrit :
>> No. a.append is a "bound method" - a method that already has an
>> associated instance, that will be provided as the first argument to the
>> method call. Bound methods are created "on the fly".
>>
> 
> Does this means there is no method to get the original methods from
> the Bound methods created "on the fly"?

There's no such thing as an "original method" - what's stored as an 
attribute of the class is a plain function. FWIW, you can get at this 
function quite easily - via the im_func attribute of the method.

Now what I wonder is what you want to do with the internal identifier of 
a function or method ? (please not that the use of the memory address as 
an id is purely an implementation detail of CPython).




More information about the Python-list mailing list