This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients alex, collinwinter, loewis, rhettinger, terry.reedy
Date 2009-05-29.23:22:19
SpamBayes Score 1.7284876e-09
Marked as misclassified No
Message-id <1243639340.85.0.864314160074.issue6133@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-05-29 23:22:21terry.reedysetrecipients: + terry.reedy, loewis, collinwinter, rhettinger, alex
2009-05-29 23:22:20terry.reedysetmessageid: <1243639340.85.0.864314160074.issue6133@psf.upfronthosting.co.za>
2009-05-29 23:22:19terry.reedylinkissue6133 messages
2009-05-29 23:22:19terry.reedycreate