On Tue, Nov 6, 2012 at 9:58 AM, Ned Batchelder <n...@nedbatchelder.com> wrote:
> On 11/6/2012 11:26 AM, R. David Murray wrote:
>>
>> On Tue, 06 Nov 2012 18:14:38 +0200, Serhiy Storchaka <storch...@gmail.com>
>> wrote:
>>>
>>> Another counterintuitive (and possible wrong) example:
>>>
>>>     >>> {print('foo'): print('bar')}
>>>     bar
>>>     foo
>>>     {None: None}
>>
>> http://bugs.python.org/issue11205
>
>
> 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.

Maybe. Do note that Python tries to be *different* than your average
C++ standard and actually prescribes evaluation orders in most cases.
The idea being that the kind of optimizations that C++ compilers get
to do by moving evaluation order around aren't worth it in Python
anyway, and it's better for the user if there are no arbitrary
differences in this area between Python implementations. Note that I
didn't say "no surprises" -- the post that started this thread shows
that surprises are still possible.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to