When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Apr 23 12:03:42 EDT 2007


En Mon, 23 Apr 2007 12:46:13 -0300, Neil Cerutti <horpner at yahoo.com>  
escribió:

> On 2007-04-23, Chris Cioffi <evenprimes at gmail.com> wrote:
>> On 23 Apr 2007 17:19:15 +0200, Neil Cerutti <horpner at yahoo.com>
>> wrote:
>>> So the question becomes: Why do Python dictionaries require
>>> keys to be of an immutable type?
>>
>> Or:  Because.  ;-)
>
> Heh, heh. I was wondering, if we dig deep enough, wether we'll
> end up back at, "just an optimization," as the reason.

Fortran guys could make programs for a long time having arrays as their  
ONLY structured type, so having a built in dictionary is not just an  
optimization, it's a luxury! :)

-- 
Gabriel Genellina




More information about the Python-list mailing list