[Numpy-discussion] comparing string array with None raises ValueError
David M. Cooke
cookedm at physics.mcmaster.ca
Thu Jun 24 22:45:16 EDT 2004
On June 24, 2004 04:10 pm, Todd Miller wrote:
> On Thu, 2004-06-24 at 15:26, David M. Cooke wrote:
> > On June 24, 2004 01:46 pm, Sebastian Haase wrote:
> > > In general it must be OK to compare anything with None, right ?
> > > (BTW, I get the same error with == and !=)
> >
> > No! Not in general!
>
> Well, this is a good point. I think the current numerical behavior was
> a hack I stuck in for people who might not be aware of "is". It's
> looking like a mistake now.
I've fixed up all uses of == None and != None in my copy of the numarray CVS,
but the anonymous CVS on SourceForge is timing out :-(, so I haven't made a
patch yet. Basically, I ran 'grep -R "[!=]= *None" *' to find all uses of ==
and != None, and replaced them with is/is not None. That would remove
possible bugs.
--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca
More information about the NumPy-Discussion
mailing list