[Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

Mark Dickinson dickinsm at gmail.com
Mon Dec 13 20:39:32 CET 2010


On Mon, Dec 13, 2010 at 3:51 PM, R. David Murray <rdmurray at bitdance.com> wrote:
> 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.

Same here, on all three counts.  In one of the projects I'm currently
working on, we've settled on a style that does quite a lot of:

my_thing = Thing(
    foo = Foo(arg1, arg2, ...),
    bar = Bar(arg3, arg4, ...),
    ...
)

and I've found the trailing comma very convenient during refactoring
and API experimentation.  (There's still good fun to be had arguing
about the indentation of that closing parenthesis, though.)

Mar


More information about the Python-Dev mailing list