PEP-308 a "simplicity-first" alternative

Erik Max Francis max at alcyone.com
Sat Feb 15 03:36:02 CET 2003


Terry Reedy wrote:

> "Erik Max Francis" <max at alcyone.com> wrote in message
> news:3E4C8329.1C13F41A at alcyone.com...
>
> > There is nothing wrong with Python's `and' and `or' semantics;
> > they're
> > very similar in functionality to those used in Lisp, for instance.
> > However, the use of the _idiom_ combining the two in order to
> > attempt to
> > the effect of a conditional operator -- `C and x or y' -- is
> > idiomatic,
> > unreadable, and _wrong_.
> 
> What do you mean when you say it is 'wrong' to combine two selection
> operators to make a selection expression?

I'm saying it's wrong because the `C and x or y' form as a substitute
for a conditional operator does not work as expected in the case of x
being false, as has been mentioned time and time again.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Man is preceded by forest, followed by desert.
\__/ (graffiti written during French student revolt)
    Computer science / http://www.alcyone.com/max/reference/compsci/
 A computer science reference.




More information about the Python-list mailing list