Part of a previous post:
"""
Here's the style I'd use:

combos = {
  0: 'id',
  2: 'country',
  3: 'type',
  5: 'lat',
  6: 'lon',
  12: 'name',
}

Put each entry on its own line, indented by two spaces, and leave a
trailing comma on the last entry. The latter is especially important
in sequences of strings to prevent them from being
"silently"<=>"concatenated" if you were to add an entry and forget the
comma.
"""

When I first saw this I thought it would lead to a syntax error so tried
it out..
Then played with it to try to recreate the '"silently"<=>"concatenated"'
problem but couldn't.  I like this syntax because it avoids the syntax
error if the comma is omitted when adding an entry but I don't understand
the (potential) concatenation problem.

Could you explain please?
alex

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to