<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 11/6/2012 1:19 PM, Devin Jeanpierre
wrote:<br>
</div>
<blockquote
cite="mid:CABicbJK+_3aFmcfegELAt=Kgd1n89jzW13ukHL3gn=woiAqUUQ@mail.gmail.com"
type="cite">
<p><br>
On Nov 6, 2012 1:05 PM, "Ned Batchelder" <<a
moz-do-not-send="true" href="mailto:ned@nedbatchelder.com">ned@nedbatchelder.com</a>>
wrote:<br>
><br>
> On 11/6/2012 11:26 AM, R. David Murray wrote:<br>
>><br>
>> On Tue, 06 Nov 2012 18:14:38 +0200, Serhiy Storchaka
<<a moz-do-not-send="true" href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>>
wrote:<br>
>>><br>
>>> Another counterintuitive (and possible wrong)
example:<br>
>>><br>
>>> >>> {print('foo'): print('bar')}<br>
>>> bar<br>
>>> foo<br>
>>> {None: None}<br>
>><br>
>> <a moz-do-not-send="true"
href="http://bugs.python.org/issue11205">http://bugs.python.org/issue11205</a><br>
><br>
><br>
> This seems to me better left undefined, since there's
hardly ever a need to know the precise evaluation sequence
between keys and values, and retaining some amount of
"unspecified" to allow for implementation flexibility is a good
thing.</p>
<p>"Left undefined"? The behavior was defined, but CPython didn't
follow the defined behaviour.</p>
</blockquote>
<br>
I would change the reference manual to leave it undefined. Clearly
not many people have been bothered by the fact that CPython
implemented it "wrong". If someone really needs to control whether
the keys or values are evaluated first, they shouldn't use a dict
literal.<br>
<br>
--Ned.<br>
<br>
<blockquote
cite="mid:CABicbJK+_3aFmcfegELAt=Kgd1n89jzW13ukHL3gn=woiAqUUQ@mail.gmail.com"
type="cite">
<p>--Devin (phone)<br>
</p>
</blockquote>
<br>
</body>
</html>