Skip to content

Commit

Permalink
bpo-35224: Add What's new entry for evaluation order in dict comprehe…
Browse files Browse the repository at this point in the history
…nsions (GH-14319)

(cherry picked from commit b51b713)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
  • Loading branch information
miss-islington and pablogsal committed Jun 25, 2019
1 parent dad8f79 commit ced9e11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.8.rst
Expand Up @@ -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
===========
Expand Down Expand Up @@ -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
---------------
Expand Down

0 comments on commit ced9e11

Please sign in to comment.