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

[Python-Dev] conditional expressions?

[Python-Dev] conditional expressions? [Python-Dev] conditional expressions?Guido van Rossum guido@python.org
Mon, 15 Oct 2001 18:02:31 -0400
> Because the conditional *ends* in something that "pulls in" all
> following binary operators and their operands until it hits a ")", 
> I find it safer not to let it accept an operator at the front.

To explain this perhaps a bit better, the 'else' keyword acts as the
right side of a low-priority binary operator with respect to the
expression that follows.  It would be unpleasant if the 'if' keyword
acted as the left side of a *high*-priority operator to the expression
that preceeds it.  Again, think of what this would mean:

    (3 * if x then y else z + 4)

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