[Python-ideas] fork

Terry Reedy tjreedy at udel.edu
Thu Aug 6 03:38:44 CEST 2015


On 8/4/2015 5:03 PM, Sven R. Kunze wrote:

>> Not true. The language clearly defines when each step happens. The
>> a.__add__ method is called,

a.__iadd__, if it exists.
https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types

 >> then the result is assigned to a, then the
>> statement finishes. (Then, in the next statement, nothing
>> happens--except, because this is happening in the interactive
>> interpreter, and it's an expression statement, after the statement
>> finishes doing nothing, the value of the expression is assigned to _
>> and its repr is printed out.)
>
> Where can find this definition in the docs?

https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements
-- 
Terry Jan Reedy



More information about the Python-ideas mailing list