This is called tuple unpacking in python, not parallel assignment.
–
Martijn PietersSep 6 '12 at 16:19

@MartijnPieters Because they are separated by commas python treats x,y like being tuple?
–
Eduard FlorinescuSep 6 '12 at 16:28

I just discovered that in FireBug console [x,y]=[y,x] works too.
–
Eduard FlorinescuSep 6 '12 at 16:36

Exactly; a tuple on the right-hand side will be unpacked into a series of variables on the left, if the lengths match. The y, x value on the right is a tuple because of the comma.
–
Martijn PietersSep 6 '12 at 16:43

1 Answer
1

CPL introduced the feature in 1963, calling it simultaneous assignment. From D.W. Barron et al., "The main features of CPL" (page 140):

24. Simultaneous assignment commands

The general form of an assignment command can now be given. Normally this is an expression yielding an LH value, followed by :=, followed by an expression yielding an RH value. However, if an explicit list is written on the left-hand side then the right-hand side is either an explicit list, or a list expression; in the latter case the transfer function Members is automatically invoked. In this form the two explicit lists must contain the same number of members, and the command denotes a simultaneous assignment of each right-hand member to the corresponding left-hand member. Thus, if L is a list variable and a, b, c are real variables,