[Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation
Nick Coghlan
ncoghlan at gmail.com
Tue Dec 14 01:31:01 CET 2010
On Tue, Dec 14, 2010 at 5:39 AM, Mark Dickinson <dickinsm at gmail.com> wrote:
> 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.)
>
Another valid use case that occurred to me is building up a string-keyed
dictionary:
mapping = dict(
x=1,
y=2,
z=3,
)
So, on reflection, removing the existing cases where it is supported is
certainly unreasonable, which makes the consistency argument that much
stronger.
For the record, I reopened issue #9232 (noting the lack of consensus), and
(as someone suggested on the tracker) changed the resolution on the other
one to be as a duplicate of #9232.
Cheers,
Nick.
P.S. As I noted in the logging discussion, my email access is going to be a
bit sketchy for the next couple of weeks.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20101214/7100b7b1/attachment.html>
More information about the Python-Dev
mailing list