[Python-Dev] conditional expressions? (original) (raw)

Greg Ward gward@python.net
Tue, 16 Oct 2001 09:00:58 -0400


On 16 October 2001, Paul Prescod said:

It actually read more easily to me the first time. As I said on python-list:

unit is meters if metric, else feet versus unit is, if metric, meters, else feet

That's confusing Python with English. They're two different languages, with different syntaxes, different semantics, and very different purposes. I wonder if a native speaker of German or Cantonese would agree with you?

I really don't see what the big fuss is about. Algol got it right 40 years ago with "if x then y else z", and (nearly?) every language since then has either made conditional expressions painfully obfuscated (Lisp, C and its ilk) or forgotten them entirely (Python). They're very useful, and just as easily abused as other powerful constructs like list comprehensions, regular expressions, or lambdas. But just because something can be abused doesn't mean it should be banned. Down that road lies Nanny Python.

    Greg

-- Greg Ward - geek gward@python.net http://starship.python.net/~gward/ Vote Cthulhu -- why settle for a lesser evil?