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 mscholle
Recipients mscholle, steven.daprano
Date 2022-02-02.15:33:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643815990.65.0.6624312354.issue46612@roundup.psfhosted.org>
In-reply-to
Content
Thanks for pointing to reference https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements

Although I can agree it tries to point to similarity with `x = x + 1`, it says about how `x += [1]` is processed:

(1) evaluate the target (`x`)
(2) evaluate the expression list (`[1]`)
(3) call `+=`, which I understand dispatch `x.__iadd__([1])`

I see there is no space left for `UnboundLocalError`.

> The assignment done by augmented assignment statements is handled the same way as normal assignments.

This is not a technical claim. They are not the same, and to claim "they are handled the same way" is strictly speaking an empty statement. For which definition of "same way"?
History
Date User Action Args
2022-02-02 15:33:10mschollesetrecipients: + mscholle, steven.daprano
2022-02-02 15:33:10mschollesetmessageid: <1643815990.65.0.6624312354.issue46612@roundup.psfhosted.org>
2022-02-02 15:33:10mschollelinkissue46612 messages
2022-02-02 15:33:10mschollecreate