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/2001-October/017972.html below:

[Python-Dev] conditional expressions?

[Python-Dev] conditional expressions?Guido van Rossum guido@python.org
Tue, 16 Oct 2001 10:20:59 -0400
> This can be solved by simply choosing a different name:
>      iif(cond, expr, expr)
>      when(cond, expr, expr)
>      cond(cond, expr, expr)
>      check(cond, expr, expr)
>      ...

-1 too.

(1) In order to do short-circuiting evaluation, the name would have to
    be recognized by the parser, which means it would have to be a new
    keyword.  None of these keywords sound attractive.

(2) It looks too much like a function call for my comfort.

I still like

    (if cond then expr else expr)

better than any of these.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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