Extension of while syntax

Ben Finney ben+python at benfinney.id.au
Thu Dec 11 22:14:29 EST 2014


(Please don't top-post; instead, interleave responses inline with the
quoted material and trim the excess. See
<URL:https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>.)

"Clayton Kirkwood" <crk at godblessthe.us> writes:

> I would prefer:
> while value = initial_value in undesired_values:
>         value = get_some_value()

The easy confusion between ‘=’ and ‘==’ in a condition is sufficient
that Python doesn't allow the ‘=’ operation in an expression.

I think that the subtle errors avoided by that is worth the loss of
expressions like the above.

-- 
 \          “Pity the meek, for they shall inherit the earth.” —Donald |
  `\                                              Robert Perry Marquis |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list