Nick Vatamaniuc wrote: >True, that is why it behaves the way it does, but which way is the >correct way? i.e. does the code need updating or the documentation? > > > Perhaps, someone can make a bug report... IMHO, docs are wrong.
-Roman >-Nick V. > >[EMAIL PROTECTED] wrote: > > >>Nick Vatamaniuc wrote: >> >> >>>Roman, >>> >>>According to the Python call syntax definition >>>(http://docs.python.org/ref/calls.html) commas should be allowed, so it >>>seems like a minor bug. Here are the lines in question: >>>-----http://docs.python.org/ref/calls.html----------- >>>call ::= primary "(" [argument_list [","]] ")" >>>argument_list::=positional_arguments ["," keyword_arguments] ["," "*" >>>expression] ["," "**" expression] >>> | keyword_arguments ["," "*" expression] ["," "**" expression] >>> | "*" expression ["," "**" expression] >>> | "**" expression >>>---------------------------------------------------------- >>>If you notice in the 'call' definition, no matter what the >>>'argument_list' is, it can be followed by an optional ',' right before >>>the closing ')'. Your code is a counterexample to this. Here is a more >>>exhaustive example: >>>-------------------------------------------------------- >>> >>> >>Actually, in the real BNF it's not allowed: >> >>http://svn.python.org/view/python/trunk/Grammar/Grammar?rev=46209&view=markup >> >>parameters: '(' [varargslist] ')' >>varargslist: ((fpdef ['=' test] ',')* >> ('*' NAME [',' '**' NAME] | '**' NAME) | >> fpdef ['=' test] (',' fpdef ['=' test])* [',']) >>fpdef: NAME | '(' fplist ')' >> >> > > > -- http://mail.python.org/mailman/listinfo/python-list