New user's initial thoughts / criticisms of Python

Tim Chase python.list at tim.thechases.com
Sat Nov 9 16:20:22 EST 2013


On 2013-11-09 21:01, Mark Lawrence wrote:
> no comma is needed but a comma  will be accepted. 

I find the optional trailing comma particularly useful (and painful in
languages that don't accept it) for doing inline lists to produce
cleaner version-control diffs.  I write most of my code like this
(with a trailing comma):

  lst = [
    "one",
    "two",
    "three",
    ]

so when I go to add something, the diff looks much more readable like

     "two",
     "three",
+    "four",
     ]

instead of

     "two",
-    "three"
+    "three",
+    "four"
     ]

which makes me look at all of the modified lines to validate exactly
what did (and didn't) change.

-tkc








More information about the Python-list mailing list