On Sun, Jun 22, 2008 at 5:32 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Sun, Jun 22, 2008 at 1:25 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: >> I don't know who designed that API but what is the reason for >> PyException_Set{Traceback,Cause,Context} not to INCREF their argument? It >> means >> the caller has to do it himself, and seems inconsistent with most of >> Python's C >> API. Is it too late to change those functions to do the right thing? > > I'm guessing Collin Winter designed it when he implemented the first > half of PEP 3134. (There is no mention of these APIs in the PEP.) > Looking at the source code it looks like all the cases so far where > these are actually used, this API is actually fortunate -- in all > cases I've found the ownership for the argument needs to be passed > into the exception object anyway.
Correct. I'll add these to the PEP/C API docs. Collin > There are some precedents, e.g. PyList_SetItem(). > > -- > --Guido van Rossum (home page: http://www.python.org/~guido/) > _______________________________________________ > Python-3000 mailing list > Python-3000@python.org > http://mail.python.org/mailman/listinfo/python-3000 > Unsubscribe: > http://mail.python.org/mailman/options/python-3000/collinw%40gmail.com > _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com