Dynamic method

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Tue Jul 17 09:46:57 CEST 2007

Daniel a écrit :
> Bruno Desthuilliers wrote:
>>> Another way is to use the 'types' module:
>> True - and that's somewhat cleaner since it doesn't expose the internals
>> of the descriptor protocol. OTHO, it can lead to strange results with
>> callables not implementing the descriptor protocol:
> <snip>
> Actually, the result is not "strange" at all if you understand what's
> going. 

Don't worry, *I* do exactly know what's going on !-)

But we all here know that newbies already tend to get confused (or at 
least perplexed) by the error message they get when they forgot the self 
argument in methods definition... FWIW, I did experiment this situation 
a couple years ago, whith a coworker that, while proficient with C and 
Perl, was somewhat new to Python. He banged his head against the wall 
for near an hour before asking for help, and it took me quite a couple 
of minutes to figure out what was going wrong.

More information about the Python-list mailing list