Python and trailing commas

In Python you can do this:

x = {
	'a': 1,
	'b': 2,
	'c': 3, # TAKE NOTE!
}

In almost every other language I can think of, you cannot. (In Python you can do this with lists and tuples and such as well)

I love this because I can reorder long lists without having to worry about fixing punctuation. Other people I have met hate this because of some principle or other.

Discuss? I dunno. Practicality beats pedantry here I guess.


About this entry