How to do this in Python...

Carl Banks imbosol at vt.edu
Mon Jan 27 16:52:59 EST 2003


Aahz wrote:
> In article <HJ3Z9.987$P64.136 at nwrddc02.gnilink.net>,
> Carl Banks  <imbosol at vt.edu> wrote:
>>Martin Maney wrote:
>>>
>>> This seems to me to be, very simply, an area where Python's
>>> intentionally chosen limitations make it awkward to compose a clear and
>>> robust solution, at least in the general case.
>>
>>You've voiced you opinion about this before, if I remember correctly.
>>Python is not going to add an assignment expression just so you can do
>>this stupid, irrelevant thing without a little awkwardness.  Live with
>>it.
> 
> You're misreading Martin.  He's *not* necessarily suggesting that
> assignment in if be permitted; it's actually more a damning of the lack
> of switch.

He certainly isn't; a switch wouldn't accomplish what he wants to do.
And he *says* all he wants is to be able to do this set-and-test idiom
without awkwardness, but I've observed a monomaniac tendency to
dismiss any solution that isn't adding an assignment operator to the
language (i.e. he defines "awkward" as anything that isn't assigment
inside the if).


-- 
CARL BANKS




More information about the Python-list mailing list