[MATRIX-SIG] array objects and if?

Konrad Hinsen hinsen@ibs.ibs.fr
Wed, 24 Sep 1997 10:46:07 +0200


> This is what I would expect, but
> 
> >>> if Numeric.array([0]):
> ...     print 1
> ... else:
> ...     print 0
> ... 
> 0

...

> isn't the way other sequences behave.

Right, but then other sequences can't be multidimensional. I don't know
whether this is supposed to happen, but I do know that I prefer to test
explicitly for what I want (zero size, zero length along any specific
axis, specific shape, etc.).
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________