[Python-Dev] Possible semantic changes for PEP 352 in 2.6
brett at python.org
Sat Sep 30 23:26:57 CEST 2006
I am working on PEP 352 stuff for 2.6 and there are two changes that I think
should be made that are not explicitly laid out in the PEP.
First, and most dramatic, involves what is legal to list in an 'except'
clause. Right now you can listing *anything*. This means ``except 42`` is
totally legal even though raising a number is not. Since I am deprecating
catching string exceptions, I can go ahead and deprecate catching *any*
object that is not a legitimate object to be raised.
The second thing is changing PyErr_GivenExceptionMatches() to return 0 on
false, 1 on true, and -1 on error. As of right now there is no defined
error return value. While it could be suggested to check PyErr_Occurred()
after every call, there is a way to have the return value reflect all
possible so I think this changed should be made.
Anybody have objections with any of the changes I am proposing?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev