mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
Issue 35224: Add PEP 572 (assignment expressions) to What's New (#12941)
This is meant as a stub, during the PyCon sprints we can iterate.
This commit is contained in:
parent
43125224d6
commit
09d434caa2
1 changed files with 16 additions and 0 deletions
|
@ -67,6 +67,22 @@ Summary -- Release highlights
|
||||||
New Features
|
New Features
|
||||||
============
|
============
|
||||||
|
|
||||||
|
Assignment expressions
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
There is new syntax (the "walrus operator", ``:=``) to assign values
|
||||||
|
to variables as part of an expression. Example::
|
||||||
|
|
||||||
|
if (n := len(a)) > 10:
|
||||||
|
print(f"List is too long ({n} elements, expected <= 10)")
|
||||||
|
|
||||||
|
See :pep:`572` for a full description.
|
||||||
|
|
||||||
|
(Contributed by Emily Morehouse in :issue:`35224`.)
|
||||||
|
|
||||||
|
.. TODO: Emily will sprint on docs at PyCon US 2019.
|
||||||
|
|
||||||
|
|
||||||
Parallel filesystem cache for compiled bytecode files
|
Parallel filesystem cache for compiled bytecode files
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue