[issue29652] Fix evaluation order of keys/values in dict comprehensions

2019-09-17 Thread Brett Cannon
Change by Brett Cannon : -- resolution: -> fixed stage: -> resolved status: -> closed ___ Python tracker ___ ___

[issue29652] Fix evaluation order of keys/values in dict comprehensions

2018-04-28 Thread janzert
janzert added the comment: Just as a note so the email discussion isn't forever lost to the void. In an unrelated thread on python-dev recently there was a short discussion on this topic in which both Guido van Rossum[1] and Tim Peters[2] gave the opinion that this

[issue29652] Fix evaluation order of keys/values in dict comprehensions

2018-04-27 Thread Nick Coghlan
Nick Coghlan added the comment: The current discrepancy is odd when you compare it to the equivalent generator expression: {k:v for k, v in iterable} dict(((k, v) for k, v in iterable)) It would never have occurred to me to expect the evaluation order to match a

[issue29652] Fix evaluation order of keys/values in dict comprehensions

2017-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think the current behavior is correct and desirable (as you say, it follows the order that would take place in an assignment, making it easy to roll-up existing for-loop code into a dict comprehension or to unroll and existing comprehension). Also, I

[issue29652] Fix evaluation order of keys/values in dict comprehensions

2017-02-27 Thread Evangelos Kounis
Changes by Evangelos Kounis : -- nosy: +EvKounis ___ Python tracker ___ ___

[issue29652] Fix evaluation order of keys/values in dict comprehensions

2017-02-26 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue29652] Fix evaluation order of keys/values in dict comprehensions

2017-02-25 Thread Jim Fasarakis-Hilliard
New submission from Jim Fasarakis-Hilliard: Reported from [1] and similar to issue11205 Currently the evaluation order for keys and values in a dictionary comprehension follows that of assignments. The values get evaluated first and then the keys: def printer(v): print(v, end='