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/2000-January/001905.html below:

[Python-Dev] Adding C ternary select (a?b:c) to Python?

[Python-Dev] Adding C ternary select (a?b:c) to Python? [Python-Dev] Adding C ternary select (a?b:c) to Python?gvwilson@nevex.com gvwilson@nevex.com
Mon, 31 Jan 2000 12:44:53 -0500 (EST)
> It (?:) would allow you to incorporate logic into expressions. 
> There are contexts where only expressions are allowed, such as:
>   - lambdas
>   - DTML expr attributes
> in which I'd very much like to incorporate tests.

Don't know much about DTML, but believe that being able to put
conditionals in lambdas would make the latter much more useful.

> > The ?: syntax
> > does not introduce any new "functionality" to the language,
> Yes it does.

Is anything possible with ?: that's impossible without? No --- Python is
Turing-equivalent before and after the change.

Is anything easier with ?: --- yes.

Does this make up for the added complexity?  Dunno (see below).

> > The second qustion I'd ask is, who is this aimed at?  It's certainly not
> > aimed at first-time programmers, as I know from experience that the ?:
> > is one of the hardest things to teach people in C (after pointers),
> Hm. I can't agree.

Strongly agree with the first author --- IME, ?: is very hard to teach.

Greg




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