Mutable objects as mapping keys

Jose M. Pereira (pereira@sabrina.inesc.pt)
Fri, 26 Mar 93 15:50:48 +0100

Guido van Rossum writes:
>
> My questions to the general public are:
>
> (1) do you think that disallowing lists as keys is a big drawback?

Not really. I can't even think of an obvious example where it would be
useful...

>
> (2) would you accept the performance penalty of always deep copying
> lists used as keys? (2a) when using lists (2b) when not using
> lists!

One of the biggest advantages of using dictionaries is the efficiency
of search (hash tables, etc...). So, I would say no at least in case (2b).

>
> (3) do you happen to have another implementation idea?

Unfortunately, I must throw another "no" in here...

----------------------------------------------------------------------
Jose' Pereira

INESC (Inst. Eng. Sistemas e Computadores)
R. Alves Redol 9, 6. 1000 Lisboa, PORTUGAL.
Phone.: +351 1 3100225 Fax...: +351 1 525843
e-mail: jmp@inesc.pt PSI...: %(0268)004010314::inesc::jmp