A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-September/056586.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.0Jim Jewett jimjjewett at gmail.com
Wed Sep 21 00:50:22 CEST 2005
Guido van Rossum:

> I think I'd prefer (if <expr> then <expr> else <expre>)

In isolation, (if .. then ... else) is an improvement, but I'm
not sure it should be viewed in isolation.

At one point, you wanted to strengthen the distinction
between statements and expressions.  Is that still true?

    x = (if y then y.val else default)

    x = (if y:
             y.val
         else:
             default)

If any statement can become an expression, that could be very useful.
There are times when it would be convenient to just grab the newly
created function (def replacing lambda) or class, or the newly imported
module.  The distinction between exec and eval starts to look 
increasingly arbitrary as well.  

But if everything becomes expression-able, people *will* start to
use parentheses instead of indentation.  

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