Interpreting Left to right?
Chris Angelico
rosuav at gmail.com
Fri Jun 24 20:32:57 EDT 2011
On Sat, Jun 25, 2011 at 7:02 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> If I have ever used this sort of multiple assignment, it has been for simple
> unambiguous things like "a = b = 0".
For which it's extremely useful. Initialize a whole bunch of variables
to zero... or to a couple of values:
minfoo=minbar=minquux=1000
maxfoo=maxbar=maxquux=0
There are times when I miss the "assignment is an expression" concept,
but I'd say this syntax covers 90% or more of use cases for assignment
expressions.
ChrisA
More information about the Python-list
mailing list