Strange location for a comma

Nick Sarbicki nick.a.sarbicki at gmail.com
Thu Sep 3 11:51:33 EDT 2015


Tim,

Doesn't work for the first column in SQL, but we tend to put the comma and
a space before the column name. It makes it easier to move things around
and (debateably) more readable. It is also very obvious when you have
missed a comma this way.

- Nick

On Thu, 3 Sep 2015 16:14 Tim Chase <python.list at tim.thechases.com> wrote:

> On 2015-09-03 14:48, Peter Otten wrote:
> > The only reason I see to add an extra comma are smaller and easier
> > to read diffs when you make a change:
>
> While that's the primary reason I do it, it's also helpful if you
> have a bunch of named keyword arguments and want sort/rearrange them
> (usually for clarity/grouping). You don't have to worry about finding
> the previous-last-item and adding a comma to it and then finding the
> new-last-item and removing its comma.  Also, when adding a new
> item, you can just copy an existing line, paste it, and modify the
> salient parts without needing to append a comma to one line or
> delete it from the pasted line.
>
> But the improvement in diff output?  That's a big win for me.
>
> I notice it most when I *can't* use it, like in writing SQL:
>
>   SELECT
>     col1,
>     col2,
>     col3, -- grr, can't do this
>   FROM tblExample
>
> so my SQL diffs are the "removed this line and replaced it with
> something almost identical except it now has a comma".  Harumph.
>
> -tkc
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
 - Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150903/a70653b9/attachment.html>


More information about the Python-list mailing list