[Matrix-SIG] Numeric arrays / assertions / truth testing
Mon, 6 Apr 1998 16:23:14 -0700 (PDT)
Is it documented how Numeric treats assertions, e.g.,
The behavior, although consistent, is somewhat counter-intuitive:
Numeric checks for identity to zero. I suggest an exposition of
this in the next round of documentation.
Python 1.5 (#63, Mar 11 1998, 14:53:33) [C] on irix5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import Numeric
>>> a = Numeric.array([1,2,3.0])
>>> assert a
>>> b = Numeric.array([0.0,0.0])
>>> assert b
Traceback (innermost last):
File "<stdin>", line 1, in ?
I was using
when I meant
assert myarray != None
The Scripps Research Institute
bsd "is located at" scripps "in the domain" edu # anti spam...