Nick Coghlan <[EMAIL PROTECTED]> writes:
> If we change that, we can use it to support an alternate invocation
> syntax for functions that currently expect an iterable as their
> first argument. "EXPR{ARGS}" would be equivalent to "EXPR((ARGS,))",
> with the following differences in the parsing of ARGS:
> x:y would be permitted, and map to a 2-tuple (x, y)
> x:y:z would be permitted, and map to a 3-tuple (x, y, z)
> x=y would be permitted, and map to a 2-tuple ('x', y)
> *x would be permitted, and would extend the passed in tuple with x
I like it. A disadvantage is that there are now three families
contexts where comma-separated sequences of exprssions appear,
with slightly different rules:
a) tuples and lists
b) function arguments
c) EXPR{ARGS}
where e.g. x=y has a different meaning in each.
Perhaps unifying a) with c) would be better, i.e. allow the above
syntactic features in tuples and lists too.
--
__("< Marcin Kowalczyk
\__/ [EMAIL PROTECTED]
^^ http://qrnik.knm.org.pl/~qrczak/
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com