Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7bd081c1
Commit
7bd081c1
authored
13 years ago
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #12531: add index entries to documentation of * and ** in function calls
parent
43a976e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Doc/reference/expressions.rst
Doc/reference/expressions.rst
+11
-5
No files found.
Doc/reference/expressions.rst
View file @
7bd081c1
...
...
@@ -667,12 +667,15 @@ dictionary containing the excess keyword arguments (using the keywords as keys
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*,...,
*x
N*, 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 a
n iterable. Elements from this iterable are treated as if they
were additional positional arguments; if there are positional arguments
*x
1*, ... ,*xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*,
this is equivalent to a call with M+N positional arguments *x1*, ..., *xN*
,
*y
1*, ..., *y
M*.
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 @@ A consequence of this is that although the ``*expression`` syntax may appear
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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment