Charles R Harris wrote: > > Raising exceptions in ufuncs is going to take some work as the inner > loops are void functions without any means of indicating an error. > Exceptions also need to be thread safe. So I am not opposed but it is > something for the future. > I just saw David Cournapeau's post regarding a NPY_NAN macro. As it uses the IEEE754 binary format, at least NPY_NAN should be True in a boolean context. So bool(nan) is True then.
And that's what happens now on my computer as well: >>> bool(nan) True I don't like Python exception's raised inside ufuncs. In the future we NumPy might add OpenMP support to ufuncs (multicore CPUs are getting common), and Python exceptions would prevent that, or at least make it difficult (cf. the GIL). S.M. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion