multiple assignments

Ben Finney ben+python at
Thu Oct 14 11:38:36 CEST 2010

Ethan Furman <ethan at> writes:

> Ah!  I was thinking the assignments went in a filter fashion, but now
> what I think is happening is that the first item is bound to the last,
> then the next item is bound to the last, etc, etc.
> Is this correct?

Assignment is always the same direction: the rightmost object is the
target, and every reference on the left of an assignment operator (the
‘=’ operator) gets bound to that same object.

 \               “There's no excuse to be bored. Sad, yes. Angry, yes. |
  `\    Depressed, yes. Crazy, yes. But there's no excuse for boredom, |
_o__)                                          ever.” —Viggo Mortensen |
Ben Finney

More information about the Python-list mailing list