I am new to python. I have a few questions coming from an armature!

Jussi Piitulainen jussi.piitulainen at helsinki.fi
Thu Aug 18 04:13:48 EDT 2016


Lawrence D’Oliveiro writes:

> On Thursday, August 18, 2016 at 7:22:50 PM UTC+12, Jussi Piitulainen wrote:
>> But please consider calling them conditional expressions.
>
> And don’t forget switch-expressions, or case-expressions, as some
> other advanced languages have had. Which my article showed how to do
> in Python.

Some such constructs in some languages are statements only.

If they are expressions, I'm happy to see their kind identified by the
keyword, as you do here. The one in Python would naturally be an
if-expression.

That looks a bit funny if the "keyword" does not look like a word, but
then programming languages do look funny, so why not:

   (c ? t : e)  # ?-expression

   (c -> t, e)  # ->-expression



More information about the Python-list mailing list