diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-06-25 01:49:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-25 01:49:07 (GMT) |
commit | ced9e11931a7a1c5cf4eef08d0dd4a4886723b43 (patch) | |
tree | 6f4a6e768afdd8905ff451a04705eb1a45b68224 /Doc/whatsnew | |
parent | dad8f79cfd83b824decb15eac4c0d5723edd4bf1 (diff) | |
download | cpython-ced9e11931a7a1c5cf4eef08d0dd4a4886723b43.zip cpython-ced9e11931a7a1c5cf4eef08d0dd4a4886723b43.tar.gz cpython-ced9e11931a7a1c5cf4eef08d0dd4a4886723b43.tar.bz2 |
bpo-35224: Add What's new entry for evaluation order in dict comprehensions (GH-14319)
(cherry picked from commit b51b7137faa22e12c570c70fe0462c662ccd935e)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.8.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 5ec3b4f..59a65bf 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -349,6 +349,9 @@ Other Language Changes is ``-1``, and a suitable power of that inverse for other negative exponents. (Contributed by Mark Dickinson in :issue:`36027`.) +* When dictionary comprehensions are evaluated, the key is now evaluated before + the value, as proposed by :pep:`572`. + New Modules =========== @@ -1499,6 +1502,11 @@ CPython bytecode changes when awaiting a next item in an :keyword:`async for` loop. (Contributed by Serhiy Storchaka in :issue:`33041`.) +* The :opcode:`MAP_ADD` now expects the value as the first element in the + stack and the key as the second element. This change was made so the key + is always evaluated before the value in dictionary comprehensions, as + porposed by :pep:`572`. (Contributed by Jörn Heissler in :issue:`35224`.) + Demos and Tools --------------- |