PEP 308 - suggestion for generalising the ternary operator

Damien Morton newsgroups1 at bitfurnace.com
Sat Feb 15 05:03:36 EST 2003


"Terry Reedy" <tjreedy at udel.edu> wrote in message
news:4Oqdnez2OokXP9CjXTWc3Q at comcast.com...
> "Damien Morton" <newsgroups1 at bitfurnace.com> wrote in message
> news:mailman.1045106276.26865.python-list at python.org...
> > These "c and x or y" forms, while currently serving as the only way
> to
> > implement the conditional selection operator, are far from
> intuitive.
>
> Since I just discovered the alternate form "(not c or x) and y", which
> works when x is null rather than non-null, years after noticing the
> and/or form. I have to admit that these are not quite as intuitive as
> I thought.  (See (PEP-308) Python's Conditional Selection Operators)
> One has to look at the definitions of and/or several times and work
> out the effect of combinations to fully get how they operate.

got me wondering if "nand" or "nor" operators might help :)
>
> > The goal of the PEP 308 discussion is to come up with a syntax for
> > conditional selection which is clear, consise, and intuitive. I dont
> think
> > obscure Pythonic workarounds are a good form to start from.
>
> I am becoming increasingly sympathetic to that view.  But I don't know
> what I will think three days from now.
>
> Terry J. Reedy

nil illigitematum carborundum

dont let the barstards grind you down








More information about the Python-list mailing list