On 11/7/2012 9:54 AM, Guido van Rossum wrote:
Hm. I really don't think that is a good development for Python to compromise in the area of expression evaluation order where side effects are involved.
I agreee. I think Python's simple left to right evaluation order is one of its virtues.
A good compiler should be able to detect the absence of potential side effects. E.g. it might reorder when only constants and simple variable references are present, or (in the case of a JIT, which has run-time type information) when it knows enough about the types of the operands involved to determine that operations like getattr or getitem are guaranteed side-effect-free.
I call this the 'as-if' rule: the compiler can take shortcuts if the result is 'as-if' no shortcut.
-- Terry Jan Reedy _______________________________________________ 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