Martin v. Löwis added the comment:
This is not limited to dictionaries. Augmented assignment *always* involves a
read operation and a write operation.
So Antoine's remark in msg215573 is more general;
a.x += 1
has a get and a set, and even
x += 1
has a get and a set.
I still agree that the original statement is confusing. It (implicitly) claims
that
x = x + 1
evaluates x twice, which it does not. Instead, x is only *evaluated* once, and
then written to. Only if x has subexpressions, they get evaluated only once
("evaluation" being the thing that produces a "value").
----------
nosy: +loewis
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21358>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com