[Numpy-discussion] Should we fix Ticket #709?

Stéfan van der Walt stefan at sun.ac.za
Wed Jul 2 16:55:12 EDT 2008


2008/7/2 Zbyszek Szmek <zbyszek at in.waw.pl>:
>> That's Ticket #709 <http://projects.scipy.org/scipy/numpy/ticket/709>:
>>
>> > I'm faily sure that:
>> > numpy.isnan(datetime.datetime.now()
>> > ...should just return False and not raise an exception.
> IMHO numpy.isnan() makes no sense for non-numerical types.

I agree with Chuck's rationale [if someone asks me whether a peanut
butter sandwhich is a Koala bear, then I'd say no, without trying to
cast the sandwhich to a mammal], and it seems that other ufuncs try to
be general this way, e.g. np.add handles arbitrary classes with
__add__ methods.

Cheers
Stéfan



More information about the NumPy-Discussion mailing list