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
dfd775a0
Commit
dfd775a0
authored
Mar 26, 2019
by
Andre Delfino
Committed by
Éric Araujo
Mar 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor doc improvement (GH-10341)
Change "star-operator" to "* operator".
parent
484f20d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Doc/library/collections.rst
Doc/library/collections.rst
+1
-1
Doc/tutorial/controlflow.rst
Doc/tutorial/controlflow.rst
+2
-2
No files found.
Doc/library/collections.rst
View file @
dfd775a0
...
...
@@ -971,7 +971,7 @@ function:
>>> getattr(p, 'x')
11
To convert a dictionary to a named tuple, use the
double-star-
operator
To convert a dictionary to a named tuple, use the
``**``
operator
(as described in :ref:`tut-unpacking-arguments`):
>>> d = {'x': 11, 'y': 22}
...
...
Doc/tutorial/controlflow.rst
View file @
dfd775a0
...
...
@@ -560,7 +560,7 @@ The reverse situation occurs when the arguments are already in a list or tuple
but need to be unpacked for a function call requiring separate positional
arguments. For instance, the built-in :func:`range` function expects separate
*start* and *stop* arguments. If they are not available separately, write the
function call with the ``*``
\ -
operator to unpack the arguments out of a list
function call with the ``*``
operator to unpack the arguments out of a list
or tuple::
>>> list(range(3, 6)) # normal call with separate arguments
...
...
@@ -573,7 +573,7 @@ or tuple::
single: **; in function calls
In the same fashion, dictionaries can deliver keyword arguments with the
``**``
\ -
operator::
``**``
operator::
>>> def parrot(voltage, state='a stiff', action='voom'):
... print("-- This parrot wouldn't", action, end=' ')
...
...
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