Super Tuples

Paul Prescod paul at prescod.net
Thu Dec 30 04:43:32 EST 1999


Justin Sheehy wrote:
> 
> Paul Prescod <paul at prescod.net> writes:
> 
> > I agree that tuples in Python are often used merely as immutable lists.
> > This bothers me
> 
> What else are they used as?

Er. Tuples. Python tuples are often used as tuples in the global sense.
They are sometimes also used as lists in the global sense.

> It really sounds like what you are asking for is a lot more like a
> dictionary than a tuple.  It sounds like you should be lobbying for a
> new mapping type, not a change to the existing (and very useful) tuple.

Everyone wants to tell me what I want. :)

I don't want a new type. I don't want enums, or read-only dictionaries.
I want 30 lines of C code and a grammar change that will make tuples
less error-prone and ugly to use. A new type wouldn't simplify my
proposal, it would complicate it.

> I see no benefit in removing any of their simplicity.

I don't see how allowing keyword assignment and attribute access
"destroys" the simplicity of tuples.

 Paul Prescod






More information about the Python-list mailing list