Terry J. Reedy <tjre...@udel.edu> added the comment:

You are right, of course: bound methods are currently created fresh on
each access, even though each is equal except for identity.  I was
thinking in terms of 
>>> str.join is str.join
True

This appears to be a classic time-space tradeoff: caching bound methods,
which is what I understand Raymond's patch does (when the attribute is a
method), saves time (with enough reuses) but takes space that could
gradually grow.

The reply to the OP could be that people who care about time should use
the standard idiom of explicitly  savingthe bound method:
>>> bjoin = ''.join
...
On the other hand, such bindings look a bit messy and tend to be local.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6133>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to