Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8423

Re: Interpreting Left to right?

References (2 earlier) <4E043953.5080705@stoneleaf.us> <20110624195300.GJ6075@point.cs.wisc.edu> <4E04EFD4.6050309@stoneleaf.us> <20110624200618.GK6075@point.cs.wisc.edu> <iu2u0a$hre$1@dough.gmane.org>
Date 2011-06-25 10:32 +1000
Subject Re: Interpreting Left to right?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.397.1308961982.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Jun 25, 2011 at 7:02 AM, Terry Reedy <tjreedy@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Interpreting Left to right? Chris Angelico <rosuav@gmail.com> - 2011-06-25 10:32 +1000

csiph-web