[Numpy-discussion] ufunc and errors

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Wed Sep 30 10:34:33 EDT 2009


I looked and looked in the docs, but couldn't find an answer to this: 
When writing a ufunc, is it possible somehow to raise a Python exception 
(by acquiring the GIL first to raise it, set a flag and a callback which 
will be called with the GIL, or otherwise?). Or should one always use 
NaN even if the input does not make any sense (like, herhm, passing 
anything but integers or half-integers to a Wigner 3j symbol).

I know how I'd to it manually in a wrapper w/ passed in context if not, 
but wanted to see.

Also, will the arguments always be named x1, x2, x3, ..., or can I 
somehow give them custom names?

Dag Sverre



More information about the NumPy-Discussion mailing list