[Python-Dev] Meaning of trailing comma?

Roman Meisl meisl@Mathematik.Uni-Marburg.de
Wed, 04 Jun 2003 16:14:38 +0200


Hello,

Following test ist possible (as far as I've understood the grammar)
(a,b,)
    ^
What's the meaning of this comma? Does it make sense?

In general, there are many rules with an optional comma (or semicolon) 
at the end, e. g.:
fplist: fpdef (',' fpdef)* [',']
exprlist: expr (',' expr)* [',']
or
testlist: test (',' test)* [',']
So I ask myself why is this?

By the way, the grammar mentioned in the online-help has very many 
errors, which leads to much confusion. Perhaps it should be exchanged 
by a correct one, shouldn't it? Or at least a hint or link to the 
correct one.

Roman Meisl


-- 
PGP-Key available
Kontakt: 
http://www.mathematik.uni-marburg.de/~meisl/kontakt.html