Super Tuples
Manuel Gutierrez Algaba
thor at localhost.localdomain
Tue Dec 28 05:43:49 EST 1999
On Mon, 27 Dec 1999 05:55:34 -0500, Paul Prescod <paul at prescod.net> wrote:
>I propose that in Python 1.6 tuples be given the demonstrated features:
>
>>>> time = (hour=24, minute=00, second=00 )
>
>(this last just demonstrates that tuples continue to work the way they
>always have. There is no magic about looking at the names of
>assignments)
>
>This proposal has the following benefits:
>
> * it makes a nice syntax for a 1-item tuple :)
> * it makes a nice syntax for non pre-declared struct-like things
> * it aligns better with the mathematical notion of tuple
This is a waste of "syntax", we could have an object in
a very similar fashion:
t = mytime(hour = ....)
> * the element referencing syntax is much clearer
> * names are easier to remember and less error prone than indexes.
> * it is still easy to rip them apart
Is this the start of a switching to tuple-oriented programming instead
of OO-programming?
Is python going back to Lisp ?
>
>This proposal may lead some to consider the unification of tuples and
>object instances, which is also a discussion worth having.
No unification, every idea must have a clearly defined syntax
construct. tuples are not for holding "enriched" "labelled" data,
their aim is to be simple. Rich tuples may handicap further
development of objects and overuse algorithms instead of
algorithms+data model of OO programming.
--
Manolo
More information about the Python-list
mailing list