Issue16319
Created on 2012-10-25 06:24 by Inyeol.Lee, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg173735 - (view) | Author: Inyeol Lee (Inyeol.Lee) | Date: 2012-10-25 06:24 | |
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 and 3.2 shows this error, not tested for 3.3 yet. |
|||
| msg173741 - (view) | Author: Chris Jerdonek (chris.jerdonek) * ![]() |
Date: 2012-10-25 07:46 | |
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]
| "**" parameter
| defparameter [","] )
(from http://docs.python.org/dev/reference/compound_stmts.html#function-definitions )
The relevant clause in the above looks to be the following, which can't give rise to a trailing comma:
"*" [parameter] ("," defparameter)* [, "**" parameter]
|
|||
| msg173742 - (view) | Author: Chris Jerdonek (chris.jerdonek) * ![]() |
Date: 2012-10-25 07:51 | |
Duplicate of issue 9232 (enhancement request). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:37 | admin | set | github: 60523 |
| 2012-10-25 07:51:34 | chris.jerdonek | set | status: open -> closed superseder: Allow trailing comma in any function argument list. messages: + msg173742 resolution: duplicate |
| 2012-10-25 07:46:01 | chris.jerdonek | set | nosy:
+ chris.jerdonek messages: + msg173741 |
| 2012-10-25 06:24:20 | Inyeol.Lee | create | |
