[Python-checkins] cpython (merge 3.2 -> default): Merge from 3.2: Issue #12531: add index entries to documentation of * and ** in

eli.bendersky python-checkins at python.org
Sat Jul 30 06:09:39 CEST 2011


http://hg.python.org/cpython/rev/221ca00121ef
changeset: 71625:221ca00121ef
parent: 71623:dc898f2a04ca
parent: 71624:a8aa918041c2
user: Eli Bendersky <eliben at gmail.com>
date: Sat Jul 30 07:07:29 2011 +0300
summary:
 Merge from 3.2: Issue #12531: add index entries to documentation of * and ** in function calls
files:
 Doc/reference/expressions.rst | 16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -667,12 +667,15 @@
 and the argument values as corresponding values), or a (new) empty dictionary if
 there were no excess keyword arguments.
 
+.. index::
+ single: *; in function calls
+
 If the syntax ``*expression`` appears in the function call, ``expression`` must
-evaluate to a sequence. Elements from this sequence are treated as if they were
-additional positional arguments; if there are positional arguments *x1*,...,
-*xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*, this is
-equivalent to a call with M+N positional arguments *x1*, ..., *xN*, *y1*, ...,
-*yM*.
+evaluate to an iterable. Elements from this iterable are treated as if they
+were additional positional arguments; if there are positional arguments
+*x1*, ... ,*xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*,
+this is equivalent to a call with M+N positional arguments *x1*, ..., *xN*,
+*y1*, ..., *yM*.
 
 A consequence of this is that although the ``*expression`` syntax may appear
 *after* some keyword arguments, it is processed *before* the keyword arguments
@@ -693,6 +696,9 @@
 It is unusual for both keyword arguments and the ``*expression`` syntax to be
 used in the same call, so in practice this confusion does not arise.
 
+.. index::
+ single: **; in function calls
+
 If the syntax ``**expression`` appears in the function call, ``expression`` must
 evaluate to a mapping, the contents of which are treated as additional keyword
 arguments. In the case of a keyword appearing in both ``expression`` and as an
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /