diff options
author | Robert Collins <rbtcollins@hp.com> | 2015-08-11 20:00:06 (GMT) |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2015-08-11 20:00:06 (GMT) |
commit | df395991f6341be037a5c6df9b14d924d5ac9e95 (patch) | |
tree | 5b0bf65fee4d6b2fc5b8f69cacc50a4bddb6d3f0 /Doc | |
parent | 5b9cd7fa2e4b73bf97a1b28c3f3a7b15c9302941 (diff) | |
download | cpython-df395991f6341be037a5c6df9b14d924d5ac9e95.zip cpython-df395991f6341be037a5c6df9b14d924d5ac9e95.tar.gz cpython-df395991f6341be037a5c6df9b14d924d5ac9e95.tar.bz2 |
Issue #9232: Support trailing commas in function declarations.
For example, "def f(*, a = 3,): pass" is now legal.
Patch from Mark Dickinson.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/reference/compound_stmts.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index 01cfd6d..00e6476 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -471,10 +471,10 @@ A function definition defines a user-defined function object (see section decorators: `decorator`+ decorator: "@" `dotted_name` ["(" [`parameter_list` [","]] ")"] NEWLINE dotted_name: `identifier` ("." `identifier`)* - parameter_list: (`defparameter` ",")* - : | "*" [`parameter`] ("," `defparameter`)* ["," "**" `parameter`] - : | "**" `parameter` - : | `defparameter` [","] ) + parameter_list: `defparameter` ("," `defparameter`)* ["," [`parameter_list_starargs`]] + : | `parameter_list_starargs` + parameter_list_starargs: "*" [`parameter`] ("," `defparameter`)* ["," ["**" `parameter` [","]]] + : | "**" `parameter` [","] parameter: `identifier` [":" `expression`] defparameter: `parameter` ["=" `expression`] funcname: `identifier` |