[docs] documentation error w/ evaluation order

Sandro Tosi sandro.tosi at gmail.com
Sat Jan 7 17:06:06 CET 2012


Hello Zach,
thanks for your email.

On Fri, Dec 16, 2011 at 04:03, Zach Wegner <zwegner at gmail.com> wrote:
> 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

I've just filed http://bugs.python.org/issue13729 to track this.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list