[PYTHON MATRIX-SIG] max/min bug?

Konrad Hinsen hinsen@ibs.ibs.fr
Tue, 28 Jan 1997 17:43:33 +0100


>   That's what I thought.  This violates the principle of least
> astonishment and really ought to be reconsidered somehow. Either it
> should do what everyone (or at least most people) expects (which is to
> return the largest/smallest element of the multidimensional array),
> or it should throw an exception and complain.

I agree, but there is no way to change the behaviour of min/max
without changing the Python interpreter. The proper solution would be
to allow comparisons to fail (e.g. throw an exception), which is not
possible right now. Then all comparisons on arrays could be made
to fail (right now they work and also compare addresses!), which would
automatically take care of min and max.

Konrad.
-- 
-------------------------------------------------------------------------------
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
_______________