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 rhettinger
Recipients belopolsky, ncoghlan, pitrou, rhettinger
Date 2009-11-05.20:23:34
SpamBayes Score 1.2182658e-06
Marked as misclassified No
Message-id <1257452616.06.0.27080089019.issue7224@psf.upfronthosting.co.za>
In-reply-to
Content
That is a false optimization.  Regular python code is full of look-ups
(even set.add has a getattr(s, 'add') lookup just to find the
add-method; every call to a built-in typically goes through multiple
lookups).   Also, the cost of a second lookup is trivial because of
processor caching:  see Object/dictnotes.txt.

Martin has already rejected a similar proposal for similar reasons. 
Please drop this one.  IMO, it is harmful to the set API because it
changes set's core concept to include lookup operations instead of just
simple set operations.

Either use sys.intern() or roll your own using get_equivalent() or a
dictionary.  A single use-case doesn't warrant building-out the
language, providing more ways to do it, or messing the core concept of
the set/frozenset datatype.
History
Date User Action Args
2009-11-05 20:23:36rhettingersetrecipients: + rhettinger, ncoghlan, belopolsky, pitrou
2009-11-05 20:23:36rhettingersetmessageid: <1257452616.06.0.27080089019.issue7224@psf.upfronthosting.co.za>
2009-11-05 20:23:34rhettingerlinkissue7224 messages
2009-11-05 20:23:34rhettingercreate