Smalltak [RE: Whitespace as syntax (was Re: Python Rocks!)]

Tim Peters tim_one at email.msn.com
Sun Feb 13 02:44:49 EST 2000


[Aahz Maruch]
> Here's an interesting question that I don't think I've seen here:
> given that the semicolon is not a significant character in Python,

But it is ("i=1; j=2; k=3;").  ? @ $ and ! are currently unused.

> why wasn't it chosen as the tuple creator?

Python's tuple notation was inherited from ABC.  Python generalized it
somewhat, but didn't fiddle.

> Would make it a lot easier to do, say,
>
> def foo(bar):
> 	print bar
>
> foo(a;b;c)

Since it's unclear why that's an interesting thing *to* do, I'm not sure why
it would be an advantage to make it easier to do it <wink>.

I must say that confusing tuples with formal argument lists is one of the
things I stumbled over in Python at first.  It took several exasperated
email rebukes from Guido before I figured out what the heck was going on.
The argument-passing rules got much saner by the time Python 1.0 was
released.  Steven Majewski probably beat up on Guido in that area too.  The
Truth is that tuples have nothing whatsoever to do with arglists anymore,
except via the "*args" varargs mechanism -- and that should probably
construct a list of arguments instead of a tuple.

ain't-broke-don't-fix-ly y'rs  - tim






More information about the Python-list mailing list