diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 3e55b3fa0f4734..abd6ed4f038d0d 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -158,9 +158,10 @@ New Features PEP 709: Comprehension inlining ------------------------------- -Dictionary, list, and set comprehensions are now inlined, rather than creating a -new single-use function object for each execution of the comprehension. This -speeds up execution of a comprehension by up to 2x. +Dictionary, list, and set comprehensions occurring inside functions are now +inlined, rather than creating a new single-use function object for each +execution of the comprehension. This speeds up execution of a comprehension by +up to 2x. Comprehension iteration variables remain isolated; they don't overwrite a variable of the same name in the outer scope, nor are they visible after the diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-01-30-15-40-29.gh-issue-97933.nUlp3r.rst b/Misc/NEWS.d/next/Core and Builtins/2023-01-30-15-40-29.gh-issue-97933.nUlp3r.rst index 2eec05cb3ace5c..8d55567a9a6d36 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2023-01-30-15-40-29.gh-issue-97933.nUlp3r.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2023-01-30-15-40-29.gh-issue-97933.nUlp3r.rst @@ -1,2 +1,2 @@ -:pep:`709`: inline list, dict and set comprehensions to improve performance -and reduce bytecode size. +:pep:`709`: inline list, dict and set comprehensions in functions to improve +performance and reduce bytecode size.