]> granicus.if.org Git - python/commitdiff
Issue 35224: Add PEP 572 (assignment expressions) to What's New (#12941)
authorGuido van Rossum <guido@python.org>
Wed, 24 Apr 2019 18:30:17 +0000 (11:30 -0700)
committerGitHub <noreply@github.com>
Wed, 24 Apr 2019 18:30:17 +0000 (11:30 -0700)
This is meant as a stub, during the PyCon sprints we can iterate.

Doc/whatsnew/3.8.rst

index bd7ad3f87cb50422df0dd465b897f0dcdac77722..ae8163a1b156fc9e022097c3bff825032971438e 100644 (file)
@@ -67,6 +67,22 @@ Summary -- Release highlights
 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
 -----------------------------------------------------