Super Tuples

Skip Montanaro skip at mojam.com
Mon Dec 27 23:12:25 EST 1999


    PP> I propose that in Python 1.6 tuples be given the demonstrated
    PP> features:

    >>> time = (hour=24, minute=00, second=00 )
    >>> print time.hour
    >>> 24

Hmm.  Attributes, but no methods?  Why doesn't the current class notion
solve the problem?  In fact, I'm not sure what the problem you're trying to
solve is.

What's the result of

    time = (hour=24, minute=00, second=00)
    point = (x=1, y=2, z=3)

    time = point

?  Is there some type-checking going on, or does time lose its
hour/minute/second attributes or just add x/y/z attributes?

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
847-971-7098   | Python: Programming the way Guido indented...




More information about the Python-list mailing list