Should the comma operator be removed in D2?
bearophile
bearophileHUGS at lycos.com
Tue Nov 17 14:11:33 PST 2009
Bill Baxter:
> > (i) should not construct a tuple. Probably (i,).
>
> That's Python's solution and it seems to work out ok.
Tuple syntax for 0, 1, n items is one of the few things that I don't like of Python :-)
In Python this is an empty tuple:
()
Or:
tuple()
This is a tuple with 1 item:
x,
This is a tuple with 3 items
x,y,z
Parentheses are not necessary unless you want an empty tuple.
Bye,
bearophile
More information about the Digitalmars-d
mailing list