PEP308: Yet another syntax proposal
Erik Max Francis
max at alcyone.com
Tue Feb 11 02:24:43 CET 2003
"James J. Besemer" wrote:
> You were asked for an example where short-circuit would be necessary
> and this
> is a well-intentioned, legitamet illustration.
> The fact (as you point out and WE ALL KNOW) that it can be rewritten
> other way does not materially add to the discussion.
Indeed. There are _always_ alternatives, everybody knows that. The
issue is not whether or not there is an expression that fundamentally
cannot be written without the conditional operator, because everybody on
both sides of the debate knows very well that there is no such thing.
That's not the question. The question is whether or not some forms are
more readable with the conditional operator than without it. It's
fundamentally frustrating when people shoot down legitimate examples of
the conditional operator with, "Oh, but you could have done it _this_
way." Well, of _course_ you could have. The question is whether the
conditional form is useful and readable on its own merits.
When people shoot down the max example (e.g., if x > y: x else: y) with
"Well, you should have used max(x, y)!" is utterly frustrating. Of
_course_ it could be written that way. We're not asking whether there's
another way to do it, we're asking whether that is readable on its own
merits. Those who are against the PEP on general principle seem to
never understand this distinction.
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ Whoever contends with the great sheds his own blood.
Polly Wanna Cracka? / http://www.pollywannacracka.com/
The Internet resource for interracial relationships.
More information about the Python-list