[issue46612] Unclear behavior of += operator

Steven D'Aprano report at bugs.python.org
Wed Feb 2 10:19:26 EST 2022


Steven D'Aprano <steve+python at pearwood.info> added the comment:

You say: "The documentation says ..." but don't tell us which documentation.

This documentation:

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


tells us that augmented assignment is assignment:

"An augmented assignment evaluates the target (which, unlike normal assignment statements, cannot be an unpacking) and the expression list, performs the binary operation specific to the type of assignment on the two operands, and assigns the result to the original target."

And also: "the assignment done by augmented assignment statements is handled the same way as normal assignments."

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46612>
_______________________________________


More information about the Python-bugs-list mailing list