For review: PEP 308 - If-then-else expression

Erik Max Francis max at alcyone.com
Sun Feb 9 02:59:23 EST 2003


Samuele Pedroni wrote:

> "Andrew Koenig" <ark at research.att.com> ha scritto nel messaggio
> news:yu99d6m277bw.fsf at europa.research.att.com...
>
> > If (1) and (2) were equivalent, I wouldn't care.  But the trouble
> > comes
> > in stuff like this:
> >
> >                 sys.exit(ok and 0 or errcode)
> >
> > which, at first glance, appears analogous to (1), but really means
> >
> >                 sys.exit(errcode)
> 
> If you repeat this argument another time, I'm gonna scream.

He should keep repeating it.  Because it's an example of why, without a
conditional operator, people who want one will resort to constructs that
are less readable and potentially inherently flawed.

It's kind of the point here.  People want conditional operators.  People
will use the workarounds that are (to my reading) semi-jokingly offered
in the FAQ.  They will write more unreadable code because of this.  And
they will introduce more bugs.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Always forgive your enemies -- nothing annoys them so much.
\__/ Oscar Wilde
    Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
 A personal guide to Quake III Arena.




More information about the Python-list mailing list