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
--
https://mail.python.org/mailman/listinfo/python-list