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
You’re currently reading “ Python and trailing commas ,” an entry on stuffonfire.com
- Published:
- 7.30.07 / 1am
- Category:
- Programming
7 Comments
Jump to comment form | comments rss [?] | trackback uri [?]