[Types-sig] New syntax?

Paul Prescod paul@prescod.net
Sat, 18 Dec 1999 14:37:30 -0600


Greg Stein wrote:
> 
> Bite me. :-)
> 
> You do raise a good point in another post, however:
> 
>   def foo(*args: (Int)):

Python should not use tuples as "read-only lists." From a type-system
point of view, a tuple should be a fixed-length, fixed-type data
structure defined at compile time.

A mathematician would not say: "A foo is a variable-length tuple of X".
Rather they would say: "A foo is a variable-langth list of X."

The "unary tuple" problem almost always arises when people are using
tuples as readonly lists also. We should just make a readonly list type
(or readonly type annotation) and be done with it. Heck, we could have
read-write tuples also!

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Three things see no end: A loop with exit code done wrong
A semaphore untested, and the change that comes along
http://www.geezjan.org/humor/computers/threes.html