id() collisions on bound methods [was: metaclass and customization with parameters]

Carlos Ribeiro carribeiro at gmail.com
Tue Oct 5 21:56:59 EDT 2004


On Wed, 6 Oct 2004 11:21:14 +1100, Andrew Durdin <adurdin at gmail.com> wrote:
> On Tue, 05 Oct 2004 23:57:52 GMT, exarkun at divmod.com <exarkun at divmod.com> wrote:
> >
> >    1) instanceObj.methodAttr results in a *new* bound method object every time it is evaluated.
> 
> **enlightenment dawns**
> 
> That's the bit that I was missing. It all makes sense now.

I just replied to you on another thread. I've come to this conclusion
after seeing your example and doing some tests, perhaps because I
remembered reading a few days ago Raymond Hettinger's docs on
descriptors where its stated something along the lines that
"descriptors are the basis for <a whole bunch of things including>
bound and unbound methods". So it made sense...

...but even so, what doesn't make sense to me is if it's worth to do
it, at each and every method invocation. I really don't know, and I'm
curious, but I have no clue where to start looking for it, or how to
measure the impact on real-time performance.

-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list