summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-01-08 22:51:29 (GMT)
committerGitHub <noreply@github.com>2023-01-08 22:51:29 (GMT)
commitbc0a686f820d7d298a0b1450b155a717972de0fc (patch)
treef4e4f5acefd28c9cb42a4db8631ed0d59165992d /Doc/whatsnew
parent8d69828092f734cd9275459173a0f89bde109659 (diff)
downloadcpython-bc0a686f820d7d298a0b1450b155a717972de0fc.zip
cpython-bc0a686f820d7d298a0b1450b155a717972de0fc.tar.gz
cpython-bc0a686f820d7d298a0b1450b155a717972de0fc.tar.bz2
gh-87447: Fix walrus comprehension rebind checking (#100581)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.12.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index b882bb6..7d318ca 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -182,6 +182,13 @@ Other Language Changes
arguments of any type instead of just :class:`bool` and :class:`int`.
(Contributed by Serhiy Storchaka in :gh:`60203`.)
+* Variables used in the target part of comprehensions that are not stored to
+ can now be used in assignment expressions (``:=``).
+ For example, in ``[(b := 1) for a, b.prop in some_iter]``, the assignment to
+ ``b`` is now allowed. Note that assigning to variables stored to in the target
+ part of comprehensions (like ``a``) is still disallowed, as per :pep:`572`.
+ (Contributed by Nikita Sobolev in :gh:`100581`.)
+
New Modules
===========