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
216d9993
Commit
216d9993
authored
Aug 04, 2015
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whatsnew/3.5: Mention PEP 448
parent
1f9a29f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
Doc/whatsnew/3.5.rst
Doc/whatsnew/3.5.rst
+43
-0
No files found.
Doc/whatsnew/3.5.rst
View file @
216d9993
...
@@ -203,6 +203,49 @@ called ``@``. (Mnemonic: ``@`` is ``*`` for mATrices.)
...
@@ -203,6 +203,49 @@ called ``@``. (Mnemonic: ``@`` is ``*`` for mATrices.)
:pep:`465` -- A dedicated infix operator for matrix multiplication
:pep:`465` -- A dedicated infix operator for matrix multiplication
PEP 448 - Additional Unpacking Generalizations
----------------------------------------------
This PEP proposes extended usages of the ``*`` iterable unpacking
operator and ``**`` dictionary unpacking operators
to allow unpacking in more positions, an arbitrary number of
times, and in additional circumstances. Specifically,
in function calls, in comprehensions and generator expressions, and
in displays.
Function calls are proposed to support an arbitrary number of
unpackings rather than just one::
>>> print(*[1], *[2], 3)
1 2 3
>>> dict(**{'x': 1}, y=2, **{'z': 3})
{'x': 1, 'y': 2, 'z': 3}
Unpacking is proposed to be allowed inside tuple, list, set,
and dictionary displays::
>>> *range(4), 4
(0, 1, 2, 3, 4)
>>> [*range(4), 4]
[0, 1, 2, 3, 4]
>>> {*range(4), 4}
{0, 1, 2, 3, 4}
>>> {'x': 1, **{'y': 2}}
{'x': 1, 'y': 2}
In dictionaries, later values will always override earlier ones::
>>> {'x': 1, **{'x': 2}}
{'x': 2}
>>> {**{'x': 2}, 'x': 1}
{'x': 1}
.. seealso::
:pep:`448` -- Additional Unpacking Generalizations
PEP 471 - os.scandir() function -- a better and faster directory iterator
PEP 471 - os.scandir() function -- a better and faster directory iterator
-------------------------------------------------------------------------
-------------------------------------------------------------------------
...
...
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