Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95939

Re: Strange location for a comma

Date 2015-09-03 09:36 -0500
From Tim Chase <python.list@tim.thechases.com>
Subject Re: Strange location for a comma
References <55e83afb$0$3157$426a74cc@news.free.fr> <55e83ce3$0$3327$426a74cc@news.free.fr> <ms9fi4$4a7$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.69.1441293213.8327.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Strange location for a comma "ast" <nomail@invalid.com> - 2015-09-03 14:20 +0200
  Re: Strange location for a comma "ast" <nomail@invalid.com> - 2015-09-03 14:28 +0200
    Re: Strange location for a comma Peter Otten <__peter__@web.de> - 2015-09-03 14:48 +0200
    Re: Strange location for a comma MRAB <python@mrabarnett.plus.com> - 2015-09-03 13:50 +0100
    Fwd: Strange location for a comma Vladimir Ignatov <kmisoft@gmail.com> - 2015-09-03 08:50 -0400
    Re: Strange location for a comma Tim Chase <python.list@tim.thechases.com> - 2015-09-03 09:36 -0500
    Re: Strange location for a comma Martin Komoň <martin@mkomon.cz> - 2015-09-03 14:34 +0200
  Re: Strange location for a comma Laura Creighton <lac@openend.se> - 2015-09-03 14:40 +0200
  Re: Strange location for a comma "ast" <nomail@invalid.com> - 2015-09-03 15:01 +0200
  Re: Strange location for a comma Laura Creighton <lac@openend.se> - 2015-09-03 15:02 +0200
  Re: Strange location for a comma "Sven R. Kunze" <srkunze@mail.de> - 2015-09-04 01:01 +0200

csiph-web