[Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)
Stephen J. Turnbull
stephen at xemacs.org
Sat Aug 8 15:19:23 CEST 2009
Steven D'Aprano writes:
> It's not immediately obvious to me why the last expression should be
> given that privileged rule. Why not the first expression?
Or the second, for that matter. So find a large body of Lisp code and
run "grep -r prog1 | wc", "grep -r prog2 | wc", and "grep -r progn | wc"
on it. I think the pragmatic answer will be obvious.
Personally, I like functional languages and style. But I admit the
*need* for a progn construct (ie, "block") to express procedural
style, and see no particular reason why expressing that by making a
syntactic distinction between expressions and statements is worse (or
better) than the progn construct. That should be kept distinct from
the question of whether extended assignment operators or conditional
operators are appropriate for a given language.
More information about the Python-Dev