[Python-3000] simplifying the exception mechanism

tomer filiba tomerfiliba at gmail.com
Mon Jan 22 22:54:51 CET 2007


with all the talk about enhancing exceptions and removing unnecessary
functions from the codebase, i think we can also drop
PyErr_NormalizeException and friends.

after all, since string exceptions are out, BDFL has mentioned
he prefered "raise Foo()" instead of "raise Foo" [1], and since the
traceback will be stored inside the exception *instance* --
there's no more need for normalization.

we can either drop the "raise TYPE" version for "raise TYPE()",
or have the raise opcode instantiate TYPE internally [2].

personally i like omitting the parenthesis when there's no
arguments to be passed, i.e. "raise EOFError",
but i could live with typing two extra characters.


-tomer

[1] pep 317 and
http://mail.python.org/pipermail/python-dev/2005-August/055665.html

[2] on a side note, java et al use "throw new FooException();".
i know this doesn't mean much, but still, exceptions are
ultimately instances.


More information about the Python-3000 mailing list