original) (raw)
(On Thu, Feb 9, 2012 at 5:18 PM, Guido van Rossum <guido@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?
mark