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

Samuele Pedroni pedronis at bluewin.ch
Sun Feb 9 10:58:56 EST 2003


"Erik Max Francis" <max at alcyone.com> ha scritto nel messaggio
news:3E460A5B.C65DB8EC at alcyone.com...
> 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.
>

OK I HAVE SCREAMED, AND CALLED YOU NAMES <.2 wink>






More information about the Python-list mailing list