Alex Martelli wrote:

>>>>import Numeric
>>>>a=Numeric.array([1,22])
>>>>b=Numeric.array([1,33])
>>>>c = a==b
>>>>c
> 
> array([1, 0])
> 
>>>>assert(c)
> 
> i.e., thanks to element-by-element evaluation, == will generally return
> a true value for ANY comparison of Numeric arrays, causing a very
> frequent beginner's bug to be sure.

Indeed. This is why numarray and scipy_core have made arrays raise an
exception when someone tries to use them as truth values.

-- 
Robert Kern
[EMAIL PROTECTED]

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to