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

Tim Peters tim.one at comcast.net
Mon Feb 10 20:06:17 EST 2003


[Andrew Koenig]
> This code works as written, but only by coincidence.

[Tim]
> You're pushing this too hard.  Pointing out examples of code
> that work fine, but wouldn't *if* you changed them, isn't a worthy
> exercise.

[James J. Besemer]
> It does support Andrew's claim that programmers less skilled than you
> attempting to use the and/or idiom are likely to make a mistake.

Show me any code you've ever written, and I'll show you how to change it so
that it no longer works as you intended.  Taking code that works and
breaking it isn't a worthy exercise.

> And aren't MOST programmers in question less skilled than you?  ;o)

Not when it comes to breaking working code <wink>.

> Of course, the fact that over half the examples posted in this thread
> contained clear errors is a stronger argument.

I saw errors in every spelling of conditionals, so that's a wash.  OTOH, I'm
at a loss to know where "over half" comes from.  Most examples were right
regardless of spelling, given what their authors claimed of them.  The
occasional honest-to-gosh error got repeated endlessly in followup posts,
though.






More information about the Python-list mailing list