Chris Jerdonek added the comment:
Duplicate of issue 9232 (enhancement request).
--
resolution: -> duplicate
stage: -> committed/rejected
status: open -> closed
superseder: -> Allow trailing comma in any function argument list.
___
Python tracker
Chris Jerdonek added the comment:
I could be misinterpreting the documentation, but it looks to me like the
examples given are behaving as documented:
parameter_list ::= (defparameter ",")*
( "*" [parameter] ("," defparameter)*
[, "**" parameter]
New submission from Inyeol Lee:
Ubuntu 12.04, python 3.2.3
Optional trailing comma causes syntax error if used for keyword-only argument
list:
These are OK --
def f(a, b,): pass
def f(a, b=None,): pass
These triggers syntax error --
def f(a, *, b,): pass
def f(a, *, b=None,): pass
python 3.1