Death to tuples!

Fredrik Lundh fredrik at pythonware.com
Tue Nov 29 16:21:37 CET 2005


sluggoster at gmail.com wrote:

> Having a general frozen() system makes a lot of sense.  People use
> tuples for two different things: as a lightweight record type (e.g.,
> (x, y) coordinate pairs), and as an immutable list.  The latter is not
> officially sanctioned but is widely believed to be the purpose for
> tuples.  And the value of an immutable list is obvious: you can use it
> as a constant or pass it to a function and know it won't be abused.  So
> why not an immutable dictionary too?  There are many times I would have
> preferred this if it were available.  frozen() is appealing because it
> provides a general solution for all container types.

    http://www.python.org/peps/pep-0351.html
    http://www.python.org/dev/summary/2005-10-16_2005-10-31.html#freeze-protocol

</F>






More information about the Python-list mailing list