PEP 308: Pep Update
David Gausebeck
gausebec-spam at paypal.com
Thu Feb 13 03:21:53 EST 2003
>The more this discussion drags on, the less I like any of the proposals.
>The current "and or" trick is looking less good to me, too, but I'm
>starting to think it's better to place more effort on programmer
>education about why it's bad than on ways to replace it with something
>less broken.
>
> "Raymond Hettinger" <vze4rx4y at verizon.net> wrote:
>
>> The leading options on the table are:
>>
>> * (if <cond>: <expr1> else: >expr2>)
>
>-0
>
>> * <cond> then <expr1> else <expr2>
>
>What does this look like in an if body?
> if cond then expr1 else expr2:
> stuff....
>
>-1
>and no, mandatory parentheses aren't good enough to fix this.
how is
if (cond then expr1 else expr2):
stuff...
worse than
if (if cond: expr1 else: expr2):
stuff....
?
The first case looks cleaner and just as intelligible to me.
-Dave
More information about the Python-list
mailing list