[issue16319] optional comma inside function argument list triggers syntax error

2012-10-25 Thread Inyeol Lee

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 and 3.2 shows this error, not tested for 3.3 yet.

--
components: Interpreter Core
messages: 173735
nosy: Inyeol.Lee
priority: normal
severity: normal
status: open
title: optional comma inside function argument list triggers syntax error
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16319
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16319] optional comma inside function argument list triggers syntax error

2012-10-25 Thread Chris Jerdonek

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]
| ** 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]

--
nosy: +chris.jerdonek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16319
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16319] optional comma inside function argument list triggers syntax error

2012-10-25 Thread Chris Jerdonek

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 rep...@bugs.python.org
http://bugs.python.org/issue16319
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com