
On Thu, Feb 9, 2012 at 5:18 PM, Guido van Rossum <guido@python.org> wrote:
Eventually, I also think this will seque and integrate nicely into Mark
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

On 2012-03-08, at 22:08 , Mark Janssen wrote:
Python calls ``hash`` on the object and uses the result.
No. Not that it makes sense, people could ask for object hashes on their own and end up with the same result.
Does anyone even use this functionality -- of a *variable* (not a string) as a dict key?
What you're asking does not make sense, the dict key is not the name but whatever object is bound to the name. And yes I've used non-string objects as names before: tuples, frozensets, integers, my own objects, …

On 2012-03-08, at 22:08 , Mark Janssen wrote:
Python calls ``hash`` on the object and uses the result.
No. Not that it makes sense, people could ask for object hashes on their own and end up with the same result.
Does anyone even use this functionality -- of a *variable* (not a string) as a dict key?
What you're asking does not make sense, the dict key is not the name but whatever object is bound to the name. And yes I've used non-string objects as names before: tuples, frozensets, integers, my own objects, …
participants (4)
-
Ethan Furman
-
Mark Janssen
-
Masklinn
-
Westley Martínez