[PYTHON MATRIX-SIG] Don't use max and min with Numeric Python!
Jim Hugunin
hugunin@mit.edu
Sun, 18 Aug 1996 13:10:57 -0400
Carlos Fonseca wrote:
> The other bug reported by Jean-Bernard ADDOR is also there:
>
> >>> max(arange(5),3)
> 0 1 2 3 4
> >>> min(arange(5),3)
> 3
This is not a bug! This is an unfortunate design decision in the python
interpreter, but there's nothing I can do about it.
What you usually think of as max should be writen maximum under Numeric
Python. I'm sure that this will trip up a lot of people, but I don't
have a good solution to this until Guido adds the ability to use
exceptions with comparision operations.
I guess I could override these builtin functions if you do from Numeric
import *, but that doesn't seem like good behavior.
Repeat: use maximum and minimum instead of max and min with array
objects.
-Jim
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================