[Numpy-discussion] comparing string array with None raises ValueError, more opinions please
Perry Greenfield
perry at stsci.edu
Thu Jun 24 13:03:05 CDT 2004
Todd Miller wrote:
> So the two choices now on the table are:
>
> 1. Change string equality comparisons to return an array of false or
> true for objects which don't convert to strings. Change Numeric
> equality comparisons in a similar fashion.
>
> 2. Special case string equality comparisons for None, as is done with
> numerical comparisons. Raise a type error for objects (other than None)
> which don't convert to string arrays.
>
> I think I like 2. Other opinions on 1 & 2? Other choices?
>
> Regards,
> Todd
>
It would seem consistency with numerical arrays is important so
unless someone presents a compelling argument for changing that
behavior for arrays, the choice appears clear.
Perry
[wishing he had spent a little more time thinking about it and
trying to remember why None is special cased for comparisons]
More information about the Numpy-discussion
mailing list