8000 Issue 35224: Add PEP 572 (assignment expressions) to What's New (#12941) · python/cpython@09d434c · GitHub
[go: up one dir, main page]

Skip to content

Commit 09d434c

Browse files
authored
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.
1 parent 4312522 commit 09d434c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ Summary -- Release highlights
6767
New Features
6868
============
6969

70+
Assignment expressions
71+
----------------------
72+
73+
There is new syntax (the "walrus operator", ``:=``) to assign values
74+
to variables as part of an expression. Example::
75+
76+
if (n := len(a)) > 10:
77+
print(f"List is too long ({n} elements, expected <= 10)")
78+
79+
See :pep:`572` for a full description.
80+
81+
(Contributed by Emily Morehouse in :issue:`35224`.)
82+
83+
.. TODO: Emily will sprint on docs at PyCon US 2019.
84+
85+
7086
Parallel filesystem cache for compiled bytecode files
7187
-----------------------------------------------------
7288

0 commit comments

Comments
 (0)
0