Destructuring is possible in python:
a, b = 1, 2
Augmented assignment is also possible:
b += 1
But is there a reason destructuring augmented assignment cannot be done?:
a, b += 1, 2
> SyntaxError: illegal expression for augmented assignment
From what I can tell, destructuring is a language thing; it cannot be modified by something like object.__add__()
. Why won't the language call object.__iadd__()
on each part of the augmented assignment separately?