to pass self or not to pass self

Jason Tackaberry tack at urandom.ca
Tue Mar 16 19:59:00 CET 2010


On Tue, 2010-03-16 at 10:04 +0100, Bruno Desthuilliers wrote:
> Answer here:
> 
> http://wiki.python.org/moin/FromFunctionToMethod

I have a sense I used to know this once upon a time, but the question
came to my mind (possibly again) and I couldn't think of an answer:

Why not create the bound methods at instantiation time, rather than
using the descriptor protocol which has the overhead of creating a new
bound method each time the method attribute is accessed?

Cheers,
Jason.





More information about the Python-list mailing list