Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
the PHP ternary operator equivalent on Python
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Steven D'Aprano, post: 1849345"] Which doesn't short-circuit: both value_if_false and value_if_true are evaluated. WHY WHY WHY the obsession with one-liners? What is wrong with the good old fashioned way? if cond: x = true_value else: x = false_value It is easy to read, easy to understand, only one of true_value and false_value is evaluated. It isn't a one-liner. Big deal. Anyone would think that newlines cost money or that ever time you used one God killed a kitten. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
the PHP ternary operator equivalent on Python
Top