A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-March/062116.html below:

[Python-Dev] conditional expressions - add parens?

[Python-Dev] conditional expressions - add parens? [Python-Dev] conditional expressions - add parens?Joe Smith unknown_kev_cat at hotmail.com
Tue Mar 7 05:26:53 CET 2006
"Steve Holden" <steve at holdenweb.com> wrote in message 
news:440CAAFB.5060702 at holdenweb.com...
> Jim Jewett wrote:
>> I think that adding parentheses would help, by at least signalling that
>> the logic is longer than just the next (single) expression.
>>
>>     level = (0 if "absolute_import" in self.futures else -1)
>>
> Contrast with the bleeding obvious:
>
>     level = 0
>     if "absolute_import" in self.futures:
>         level = -1
>
> or even, if a certain obscurity is desirable:
>
>     level = - ("absolute_import" in self.futures)
>

Wait a second.

I may be just a user but if the above is correct then that syntax needs to 
die!
There is no logical reason for "XX if YY else ZZ" to be roughly equivlent 
to:
"if (YY) then {ZZ} else {XX}" , but AFAICT that is pretty much the way you 
expanded that.
I hope I misunderstood, or that there was a typo in a post.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4