No subject


Thu Nov 16 16:52:29 CST 2006


"The expression x and y first evaluates x; if x is false, its value is
returned; otherwise, y is evaluated and the resulting value is
returned."

So the "and" is just returning its second argument, since both arguments
are considered "True" (containing at least 1 "True" element).

On Tue, 2002-06-11 at 23:27, Geza Groma wrote:
> Using Numeric-21.0.win32-py2.2 I found this:
>=20
> Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from Numeric import *
> >>> a =3D array((1, 1), 'b')
> >>> b =3D array((1, 0), 'b')
> >>> a and b
> array([1, 0],'b')
> >>> b and a
> array([1, 1],'b')
> >>>
>=20
> It looks like a bug, or at least very weird. a&b and b&a work correctly.
>=20
> --
> G=E9za Groma
> Institute of Biophysics,
> Biological Research Center of Hungarian Academy of Sciences
> Temesv=E1ri krt.62.
> 6726 Szeged
> Hungary
> phone: +36 62 432 232
> fax:   +36 62 433 133
>=20
>=20
>=20
> _______________________________________________________________
>=20
> Sponsored by:
> ThinkGeek at http://www.ThinkGeek.com/
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reggie Dugard
Merfin, LLC





More information about the Numpy-discussion mailing list