Comma is not always OK in the argument list?!

Roman Susi rnd at onego.ru
Fri Jul 28 06:54:06 EDT 2006


Hi!

it is interesting that I found this syntax error:

>>> a = {}
>>> str('sdfd', **a,)
  File "<stdin>", line 1
    str('sdfd', **a,)
                   ^
SyntaxError: invalid syntax


I just wonder is it intentional or by-product (bug or feature)?
(The behaviour makes sense, of course... I tend to leave commas when I
expect a list to be added to (i.e. almost always ;-)))


Regards,
Roman



More information about the Python-list mailing list