On Mar 7, 2006, at 7:29 AM, Steve Holden wrote:
...
>> In fact, I think the below examples are reasonable uses
>> that do a better job of expressing intent than the if
>> statement would. I just don't like the mental backtrack
>> they require, and would like some sort of advance
>> warning. Parentheses at least tell me "You're not done
>> yet; keep reading."
>>
>>>>> ack(r,r) if r not in cache
>>
>>>>> log(message) if error_flag
>>
> I think you've misunderstood the nature of the change. HTe new
> conditionals are *expressions*, they aren't postfix conditionals for
> statements.
Right, but the only effect of that on the examples is that they both
need an 'else None' continuation or thereabouts.
I also predict widespread over-use of the new toy and agree with Jim
that mandatory parentheses around the whole (X if Y else Z) construct
would ameliorate legibility a bit.
Alex
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com