Arithmetic sequences in Python

Alex Martelli aleax at mail.comcast.net
Wed Jan 18 21:31:34 EST 2006


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:
   ...
> Well, [...] notation for regular lists (as opposed to list
> comprehensions) is also unnecessary since we could use "list((a,b,c))".

Indeed, there's no reason list couldn't accept multiple arguments as an
alternative to one sequence argument, just like min and max.  This would
make list(a, b, c) work just perfectly.

> Are we -really- after syntax minimalism?  And if we are, shouldn't we
> just all switch to using Scheme?

No, we're not after syntax minimalism (which might justify moving to
Lisp or Scheme) but syntax that's simple and readable.  I see no
credibly simple and readable alternative to {a:b, c:d} dictionary
display syntax, for example; dict(((a,b),(c,d))) just wouldn't cut it,
because of the "parentheses overload" (double entendre intended).  But
list has no such problem, and there's really no added value of clarity
and readability in [a,b,c] vs list(a,b,c).  And don't tell me that the
added value is that brackets "suggest lists", since they're used to
index tuples and dicts just as well;-).  So the only reason they may
"suggest lists" is that you're used to that display form in Python, but
there's no real reason to HAVE a display form for lists at all, IMHO.


Alex



More information about the Python-list mailing list