Python 3.0 - is this true?

Aahz aahz at pythoncraft.com
Mon Nov 10 15:40:05 CET 2008


In article <roy-6D96B6.19261609112008 at news.panix.com>,
Roy Smith  <roy at panix.com> wrote:
>
>The point is that you're forced to use lists to compute the sub-sequences.  
>This makes sense, because lists fit the "indefinite length sequence" idea.  
>Then, you're forced to use tuples as the dictionary keys, because tuples 
>are immutable/hashable, while lists are not.  This use of tuples doesn't 
>fit the "inherently fixed-sized collection of heterogeneous objects" idea 
>of a tuple.  In this case, a tuple really is just an immutable list.  Your 
>choice of containers is not based on any theoretical arguments of what each 
>type was intended to represent, but the cold hard reality of what 
>operations they support.

Note that one can, of course, write Python classes that do exactly what
you want.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan



More information about the Python-list mailing list