Marek Scholle <mscho...@purestorage.com> added the comment:
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"? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46612> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com