[Python-Dev] trailing commas on statements
Chris Angelico
rosuav at gmail.com
Wed Aug 12 02:54:01 CEST 2015
More information about the Python-Dev mailing list
Wed Aug 12 02:54:01 CEST 2015
- Previous message (by thread): [Python-Dev] trailing commas on statements
- Next message (by thread): [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Aug 12, 2015 at 3:01 AM, R. David Murray <rdmurray at bitdance.com> wrote: > Sorry, "trailing comma outside ()" was a shorthand for 'trailing comma > on a complete statement'. That is, what trips me up is going from > something like: > > dict(abc=1, > foo=2, > bar=3, > ) > > to: > > abc = 1, > foo = 2, > bar = 3, > > That is, I got rid of the dict(), but forgot to delete the commas. > (Real world examples are more complex and it is often that the > transformation gets done piecemeal and/or via cut and paste and I only > miss one or two of the commas... > > But, for backward compatibility reasons, we wouldn't change it even if > everyone thought it was a good idea for some reason :) Sure. In that case, I agree with you completely. When I *do* want a tuple, I'll usually be putting it inside parens, rather than just tagging a comma on. But this can be the job of a linter. ChrisA
- Previous message (by thread): [Python-Dev] trailing commas on statements
- Next message (by thread): [Python-Dev] PEP needed for http://bugs.python.org/issue9232 ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list