Brett Cannon schrieb:
> It doesn't need to, it just would have been convenient and consistent.
>  It seems odd that C code can compare an exception against other
> objects that an 'except' clause won't.

If you look at the C code, you find that there are very few callers
to GivenExceptionMatches (even if you also count ExceptionMatches
callers), and they either pass a PyExc_ object (which will automatically
be permitted), or one of their own exceptions. If you were to remove
PyErr_GivenExceptionMatches, and replace it with something else
where
a) people have to change the functions in their code, and
b) have to check the return value for errors (which they can
    statically determine to never happen)
I think the authors would be unhappy about this gratuitous change.

>> The deprecation of string exceptions already happens in cmp_outcome;
>> if you check for bad base exceptions there also, you would find them
>> all, no?
> 
> It wouldn't be checked in both places, just PyErr_GivenExceptionMatches().

Please don't.

Martin

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to