[Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation
R. David Murray
rdmurray at bitdance.com
Mon Dec 13 16:51:19 CET 2010
On Mon, 13 Dec 2010 23:25:58 +1000, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Mon, Dec 13, 2010 at 9:44 PM, Jan Kaliszewski <zuo at chopin.edu.pl> wrote:
> > I think that seeing that:
> > =A0 =A0def f(a, b): ...
> > =A0 =A0def f(a, *, b): ...
> > =A0 =A0def f(a, *args, b): ...
> > =A0 =A0x(1, 2, 3, 4, z=3D5)
> > =A0 =A0x(1, *(2,3,4), z=3D5)
> As per the closure of the affected tickets, the likely outcome of such
> a discussion would be the deprecation and subsequent removal of
> support for the following two options:
> def f(a, b,): ...
> x(1, 2, 3, 4, z=3D5,): ...
> Function arguments are not lists. Even when separated onto multiple
> lines, the closing "):" should remain on the final line with other
> That would be a lot of hassle to get rid of something that people
> probably aren't doing in the first place, though.
Counter examples from google code search:
(also appears in json in the stdlib)
Not many, granted, but not zero, either, and I'm sure there are lots
more out there[*]. I do especially like the fact that there is one in the
It seems like the status quo is fine. I wouldn't object to it being
made more consistent. I would object to removing the existing cases.
R. David Murray www.bitdance.com
[*] code search's response to various regexes was somewhat surprising;
expressions I thought should have been supersets resulted in fewer
hits. Nor could I think of a way to search for function invocations
ending with a comma. Then again, I usually make lots of mistakes
More information about the Python-Dev