[docs] documentation error w/ evaluation order

Zach Wegner zwegner at gmail.com
Fri Dec 16 04:03:38 CET 2011


In http://docs.python.org/reference/expressions.html#evaluation-order,
there's a table that contains this entry, giving the order of
evaluation for dict literals:

{expr1: expr2, expr3: expr4}

However, for each item, the value is evaluated before the key, like so:

def ev(r):
    print(r)
    return r

{ev(1): ev(2), ev(3): ev(4)}

prints (under 3.2.2):

2
1
4
3

Thanks,
Zach


More information about the docs mailing list