The unPEP: List-Tuple Unification

Steve Holden sholden at holdenweb.com
Fri Jul 20 14:53:07 EDT 2001


"Raymond Hettinger" <othello at javanet.com> wrote in message
news:3B587279.A225AC51 at javanet.com...
> Steve Holden wrote:
>
> > No asbestos required, but what's tha advantage over
> >
> >     mylist = tuple(mylist)
> >
> > just-wonderingl-ly y'rs  - steve
>
> Good question. Immutable lists don't give you much over
> what you get now from tuples (except the automatic coercion
> for dictionary keys).
>
> The big advantage comes from deprecating tuples, simplifying
> the language, getting rid of (,) and eliminating the need to remember
> which things require tuples, which require lists, and which allow
> both (quick, what does the % formatting operator require?).
>
A tuple. Or a single object. But instead of testing whether things were
tuples, you'd then have to check whether the list was immutability. I don't
see why immutability has to be a one-way attribute when converiosn between
list and tuple is so easy.

> never-met-a-list-i-didnt-like,ly y'rs  -- Raymond

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list