[Python-3000] how should we handle changes to the C API?

Brett Cannon brett at python.org
Tue Feb 13 21:46:59 CET 2007


On 2/12/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Brett Cannon schrieb:
> >> I'm unclear why you want to warn in PyErr_GivenExceptionMatches:
> >> shouldn't you rather warn when the exception is raised?
> >>
> >
> > Guido wants both so that you don't end up with useless values in the
> > 'except' clause.  So yes, things are checked at the time of raising an
> > exception, but that does not prevent someone from putting something in
> > an 'except' clause that is useless.
>
> Ok: but why does this check need to happen in PyErr_GivenExceptionMatchs?
>

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.

> 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().

-Brett


More information about the Python-3000 mailing list