On 12/13/2010 1:55 PM, Raymond Hettinger wrote:
It seems to me that a trailing comma in an argument list is more likely to be a
user error than a deliberate comma-for-the-future.
It seems to me that a trailing comma, especially in the case of one
parameter per line, is a deliberate comma-for-the-future. It's a good
reminder that you are dealing with a list of some sort, rather than a
statement, when you look at just one parameter on the line.
Especially if the ) is on the next line, which I prefer.
Yes, a parameter list is not a python list, nor a python tuple, but it
is still a generic, comma-separated list, and all such are more
conveniently dealt with, in the multi-line case, if trailing commas are
permitted. And, of course, the one-entry tuple needs the comma to
differentiate it from some other expression, forcing the trailing comma
into the syntax... so there can be no consistent rule for all commas
that doesn't permit trailing commas.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com