[Numpy-discussion] Questions on error handling/refcounting in some ufunc object loops.
Charles R Harris
Fri Nov 14 00:00:31 CST 2008
On Thu, Nov 13, 2008 at 10:31 PM, David Cournapeau <
> Charles R Harris wrote:
> > I'm pretty sure about the reference leak. But what should be the
> > standard for checking arguments and error returns in these object loops?
> I was wondering the same when I worked on that code a few weeks ago;
> since the ufunc "return" void, I wonder how feasible it would be to
> return an int instead for error messaging. Since the ufunc are not used
> directly outside numpy, it should not break the API/ABI in any way ?
I had thoughts along the same line. I think we could easily make all the
returns ints because the return value would simply be discarded. The
question is what to do with it if we have it.
> I think more generally it would be nice to have a common error system
> for the pure C code, because it is a bit of a mess right now. But that
> would be again a lot of work :)
Yep. And tracking/checking all those errors back up the call chain is a
pain. The best argument for C++ I can think of is the exception handling...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion