[New-bugs-announce] [issue16777] "Evaluation order" doc section is wrong about dicts

Ezio Melotti report at bugs.python.org
Tue Dec 25 14:54:47 CET 2012


New submission from Ezio Melotti:

http://docs.python.org/2/reference/expressions.html#evaluation-order
says that the dicts are evaluated in this order:
  {expr1: expr2, expr3: expr4}

however each value is evaluated before the respective key:
def f(x):
  print(x)
  return x

{f('k1'): f('v1'), f('k2'): f('v2')}

v1
k1
v2
k2
{'k1': 'v1', 'k2': 'v2'}

----------
assignee: ezio.melotti
components: Documentation
messages: 178127
nosy: chris.jerdonek, ezio.melotti
priority: normal
severity: normal
stage: needs patch
status: open
title: "Evaluation order" doc section is wrong about dicts
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16777>
_______________________________________


More information about the New-bugs-announce mailing list