]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
clarify trailing comma in function argument list
authorFred Drake <fdrake@acm.org>
Tue, 2 Nov 2004 18:59:18 +0000 (18:59 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 2 Nov 2004 18:59:18 +0000 (18:59 +0000)
(SF bug #798652)

Doc/ref/ref5.tex
Doc/ref/ref7.tex

index 804498b1f3252a8ea8a563b2e08b943ced984a0a..9fdd4ff509b12f425ba18a259bc4b7726f7bbfd8 100644 (file)
@@ -444,8 +444,8 @@ series of arguments:
              {\token{identifier} "=" \token{expression}}
 \end{productionlist}
 
-A trailing comma may be present after an argument list but does not
-affect the semantics.
+A trailing comma may be present after the positional and keyword
+arguments but does not affect the semantics.
 
 The primary must evaluate to a callable object (user-defined
 functions, built-in functions, methods of built-in objects, class
index 1c6d3691a918861f3b6a551acbcbfe245ab7a8c3..44a58c86dfddb6375717a16bd47303208e0a6b24 100644 (file)
@@ -318,10 +318,10 @@ section~\ref{types}):
              {"def" \token{funcname} "(" [\token{parameter_list}] ")"
               ":" \token{suite}}
   \production{parameter_list}
-             {(\token{defparameter} ",")*}
-  \productioncont{("*" \token{identifier} [, "**" \token{identifier}]}
-  \productioncont{| "**" \token{identifier}
-                  | \token{defparameter} [","])}
+                 {(\token{defparameter} ",")*}
+  \productioncont{(~~"*" \token{identifier} [, "**" \token{identifier}]}
+  \productioncont{ | "**" \token{identifier}}
+  \productioncont{ | \token{defparameter} [","] )}
   \production{defparameter}
              {\token{parameter} ["=" \token{expression}]}
   \production{sublist}