Evaluation order

candide c.candide at laposte.net
Fri Jul 10 02:10:18 CEST 2015


The official doc explains that :

Python evaluates expressions from left to right.

cf. https://docs.python.org/3.3/reference/expressions.html#evaluation-order


But consider the following snippet :


>>> t=[2020, 42, 2015]
>>> t*(1+int(bool(t.sort())))
[42, 2015, 2020]
>>>


Is there not some contradiction with left-right evalutation? 







More information about the Python-list mailing list