Trailing comma

Lulu of the Lotus-Eaters mertz at gnosis.cx
Tue Oct 21 14:32:44 EDT 2003


Skip Montanaro <skip at pobox.com> wrote previously:
|if the list is not a list of string constants there's no real harm in
|omitting it either, because if you extend or reorder the list and forget to
|insert a comma in the right place you'll get a SyntaxError

Not necessarily:

    >>> x = [1,
    ...      -4,
    ...      +5
    ...      -2,
    ...      7]
    >>> x
    [1, -4, 3, 7]

Which makes the point even stronger, however.

--
 mertz@  _/_/_/_/ THIS MESSAGE WAS BROUGHT TO YOU BY: \_\_\_\_    n o
gnosis  _/_/             Postmodern Enterprises            \_\_
.cx    _/_/                                                 \_\_  d o
      _/_/_/ IN A WORLD W/O WALLS, THERE WOULD BE NO GATES \_\_\_ z e






More information about the Python-list mailing list