[Python-ideas] PEP

Mark Janssen dreamingforward at gmail.com
Thu Mar 8 22:08:23 CET 2012

On Thu, Feb 9, 2012 at 5:18 PM, Guido van Rossum <guido at python.org> wrote:

>  A dictionary would (then) be a SET of these. (Voila! things have already
>> gotten simplified.)
> Really? So {a:1, a:2} would be a dict of length 2?

  Eventually, I also think this will seque and integrate nicely into Mark
>> Shannon's "shared-key dict" proposal (PEP 412).
I just noticed something in Guido's example.  Something gives me a strange
feeling that using a variable as a key doesn't smell right.  Presumably
Python just hashes the variable's id, or uses the id itself as the key, but
I wonder if anyone's noticed any problems with this, and whether the hash
collision problems could be solved by removing this??   Does anyone even
use this functionality -- of a *variable* (not a string) as a dict key?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120308/d58e35af/attachment.html>

More information about the Python-ideas mailing list