[Python-checkins] Issue 35224: Add PEP 572 (assignment expressions) to What's New (#12941)

Guido van Rossum webhook-mailer at python.org
Wed Apr 24 14:34:26 EDT 2019


https://github.com/python/cpython/commit/09d434caa2c01477ea2ccc3e9b88e9faa0107c61
commit: 09d434caa2c01477ea2ccc3e9b88e9faa0107c61
branch: master
author: Guido van Rossum <guido at python.org>
committer: GitHub <noreply at github.com>
date: 2019-04-24T11:30:17-07:00
summary:

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.

files:
M Doc/whatsnew/3.8.rst

diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index bd7ad3f87cb5..ae8163a1b156 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -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
 -----------------------------------------------------
 



More information about the Python-checkins mailing list