This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients docs@python, ferno, terry.reedy
Date 2013-12-14.02:55:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386989731.39.0.597709518015.issue19953@psf.upfronthosting.co.za>
In-reply-to
Content
The current doc is correct. Unlike the old incorrect version of the operator doc (#7259), it does not say that the call is all of the execution. The suggested replacement "x = x.__iadd__(y) is called" is not correct as statements are not called.

The said, it seems that some people miss the fact that augmented assignment always does an assignment. So, considering that the first sentence of the paragraph, "These methods are called to implement the augmented arithmetic assignments (+=, -=, *=, /=, //=, %=, **=, <<=, >>=, &=, ^=, |=)." already talks about calling, I thing

"For instance, to execute the statement x += y, where x is an instance of a class that has an __iadd__() method, x.__iadd__(y) is called. If x is an instance of a class that does not define a __iadd__() method, x.__add__(y) and y.__radd__(x) are considered, as with the evaluation of x + y."

might be replaced by

"For instance, if x is an instance of a class with an __iadd__() method, x += y is equivalent to x = x.__iadd__(y) . Otherwise, x.__add__(y) and y.__radd__(x) are considered, as with the evaluation of x + y."
History
Date User Action Args
2013-12-14 02:55:31terry.reedysetrecipients: + terry.reedy, docs@python, ferno
2013-12-14 02:55:31terry.reedysetmessageid: <1386989731.39.0.597709518015.issue19953@psf.upfronthosting.co.za>
2013-12-14 02:55:31terry.reedylinkissue19953 messages
2013-12-14 02:55:30terry.reedycreate