Why is lambda allowed as a key in a dict?

Lie Ryan lie.1296 at gmail.com
Thu Mar 12 02:06:15 EDT 2009


Terry Reedy wrote:
> r wrote:
>> On Mar 11, 3:40 pm, Craig Allen <callen... at gmail.com> wrote:
>>> On Mar 10, 1:39 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> 
>>>> Identical strings don't necessarily have the same id:
> 
> A more verbose way to put this is "Requesting a string with a value that 
>  is the same an an existing string does not necessarily result in reuse 
> of the existing string but mey result in creation of a new, duplicate 
> string.

I'd rather go with: "All object creation will create a new object; 
except for immutable for which the object creator may choose to return 
an equivalent existing object."

Immutables are the exception.



More information about the Python-list mailing list