[Python-Dev] Trinary Operators

Guido van Rossum guido@python.org
Fri, 07 Feb 2003 10:06:41 -0500


> Oh dear. If you are really going to do these these cutesy English-like
> expressions I'd have to resurrect my old proposal of:
> 
> if CONDITION for some NAME in ITERABLE:
> if CONDITION for every NAME in ITERABLE:
> if CONDITION for no NAME in ITERABLE:
> 
> Please, dont make me do that ;-)

An if-expression is frequently requested, and I expect people will
continue to ask for it until I add one :-)

Who (besides you) has ever asked for generalized quantifiers?  They
were in ABC, with slightly different syntax: 

  >>> IF EACH x IN {3; 6; 9} HAS x mod 3 = 0: WRITE "Yes"
  Yes
  >>>

But they weren't useful enough IMO to bother incorporating at the
time.

--Guido van Rossum (home page: http://www.python.org/~guido/)