Trailing comma (was: Re: structure in Python)
Georgy Pruss
SEE_AT_THE_END at hotmail.com
Fri Oct 24 03:15:28 EDT 2003
"Patrick Maupin" <pmaupin at speakeasy.net> wrote in message news:653b7547.0310231853.215189da at posting.google.com...
> Cousin Stanley wrote:
>
> > The style that looks the most natural and seems the easiest
> > to extend and edit to me is ....
> >
> > x = [ 'fe' ,
> > 'fi' ,
> > 'fo' ,
> > 'fum' ]
>
> Other people have raised some good points as to why using
> trailing commas can be better, but for my money the best
> reason to consistently use trailing commas is how a CVS
> (or other) diff will look later. You can either see
> one deleted line plus two added lines, or a single added
> line, your choice.
>
> Pat
You can always find a better diff which will show you an added
comma and an additional line. Again, it's a tool problem.
Georgy
More information about the Python-list
mailing list