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/017971.html below:

[Python-Dev] conditional expressions?

[Python-Dev] conditional expressions?Walter Dörwald walter@livinglogic.de
Tue, 16 Oct 2001 15:46:05 +0200
Guido van Rossum wrote:

> Even after reading Daniel's passionate plea, if(cond,expr,expr) looks
> ugly to me.  It also doesn't solve the parsing ambiguity problem -- it
> still can't be allowed in an expression that starts a line because the
> parser doesn't know whether it's an if expression or an if statement
> without many tokens of lookahead.


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)
     ...

> So, -1 for if(cond,expr,expr).


Bye,
    Walter Dörwald




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