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/2005-September/056584.html below:

[Python-Dev] Adding a conditional expression in Py3.0

[Python-Dev] Adding a conditional expression in Py3.0 [Python-Dev] Adding a conditional expression in Py3.0Thomas Lotze tl at gocept.com
Wed Sep 21 00:21:00 CEST 2005
Barry Warsaw wrote:

> I'm not so sure.  Once you start writing such a complicated thing, I think
> readability will favor just breaking the code out into traditional
> if-blocks.  I'd be happy enough with just a binary condition.

Nothing prevents you from spreading the code over multiple lines, like so:

x = (if a then b
     elif c then d
     else e)

or even

x = (if a then
        b
     elif c then
        d
     else
        e
    )

especially as there are going to be parentheses around the whole thing
anyway. From a readability point of view, this is no different from
if-statement blocks, and the matter is IMO not worth dumbing down an
if-expression thingy as compared to its if-statement companion.

-- 
Thomas


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