Simultaneous assignment semantics in Python
In this case: i, a[i] = i + 1, i The righthand side evaluates to a tuple (1, 0). This tuple is then unpacked to i and then a[i]. a[i] is evaluated during the unpacking, not before, so corresponds to a[1]. Since the righthand side is evaluated before any unpacking takes place, referring to a[i] … Read more