Raymond Hettinger added the comment:

This is a bummer.  The internal comments made the claim that any python object 
would suffice.   The use of a unicode object was unfortunate because it isn't 
guaranteed to be unique (i.e. a user can legitimately store "<dummy>" as a 
valid member of a set).  As a consequence, the tight loops for the hash table 
lookups had to add special case checks for the dummy variables.  Eliminating 
those checks made the generated code shorter and faster.  It also paved the way 
for a future optimization for non-debug builds to eliminate all non-essential 
increfs and decrefs to the dummy object.

In other words, we're paying a price for the dummy object being printable as a 
string.

Antoine, thanks to the link to the python-dev discussion.  I hope we can come 
with a solution that doesn't involve going back to unicode objects.

----------

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

Reply via email to