PEP 317: Eliminate Implicit Exception Instantiation
Steven Taschuk
staschuk at telusplanet.net
Mon Jun 9 19:11:39 EDT 2003
Quoth Ed Avis:
> Steven Taschuk <staschuk at telusplanet.net> writes:
>
> > raise_stmt ::= "raise" [expression ["," expression]]
>
> Why not go further and make it look like a normal function call, that
> can take zero one or two arguments?
>
> raise_stmt ::= "raise" "(" [expression ["," expression]] ")"
Two reasons:
First, it would increase the backwards incompatibility, which is
already quite large. Under such a change, *all* raise statements
would need to be revised; under the change proposed, those who
have been using the One True Syntax for raising exceptions (i.e.,
instantiating explicitly) are exempt.
Second, I don't object to raise being a statement; in particular,
I don't think its being a statement makes any code less clear.
Implicit exception instantiation, however, I do believe to be
significantly less clear than explicit instantiation.
(I also don't have any particular wish to use raise in lambdas. I
have followed the timbot's alleged injunction to learn to love the
return key.)
--
Steven Taschuk Aral: "Confusion to the enemy, boy."
staschuk at telusplanet.net Mark: "Turn-about is fair play, sir."
-- _Mirror Dance_, Lois McMaster Bujold
More information about the Python-list
mailing list