<p dir="ltr">Anyway, if we enter this kind of discussion, it is a reliable indication that the code smells. There is a pythonic way to express the same task:</p>
<p dir="ltr">>>> t.sort()<br>
>>> t</p>
<p dir="ltr">kind regards</p>
<p dir="ltr">Thierry</p>
<div class="cm_quote" style=" color: #787878">On ven., juil. 10, 2015 at 2:28 PM, Terry Reedy <<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>> wrote:</div><br><div id="oldcontent" style="background: rgb(255, 255, 255);"><blockquote style=""><p dir="ltr">On 7/10/2015 8:04 AM, candide wrote:<br>
> Le vendredi 10 juillet 2015 04:02:56 UTC+2, Chris Angelico a écrit :<br>
>> I'm not sure what contradiction you're referring to, here. The<br>
>> evaluation that you're pointing out says, as Terry showed via the<br>
>> disassembly, that Python's first action is to look up the name 't' and<br>
>> grab a reference to whatever object it points to.<br>
><br>
> But in order to perform an operation, the interpreter has to evaluate<br>
 > the operands and "evaluating" is not "grabbing a reference to".</p>
<p dir="ltr">In the CPython, evaluating a name is implemented as getting the <br>
reference corresponding to the name.</p>
<p dir="ltr">>> The execution of<br>
>> t.sort() has to happen before the multiplication, because of the<br>
>> parentheses.</p>
<p dir="ltr">> Official docs explains what evaluation is :<br>
><br>
> When the name is bound to an object, evaluation of the atom yields that object.</p>
<p dir="ltr">Conceptually, that is exactly right.  How that is implemented on a <br>
computer in CPython is to load the address on the top of the virtual <br>
machine stack.</p>
<p dir="ltr">> So, since the Python interpreter is performing evaluation from left to right,<br>
 > the first operand of the expression :<br>
><br>
> t*(1+int(bool(t.sort())))<br>
><br>
> evaluates to [2020, 42, 2015].</p>
<p dir="ltr">'t' evaluates to the ***mutable*** list that 't' is bound to.</p>
<p dir="ltr">>  Next, the second operatand evaluates to the integer 1.</p>
<p dir="ltr">And in the process of that evaluation, the list is sorted.<br></p>
<p dir="ltr">-- <br>
Terry Jan Reedy<br></p>
<p dir="ltr">-- <br>
https://mail.python.org/mailman/listinfo/python-list<br>
</p>
</blockquote></div>