[PYTHON MATRIX-SIG] Some notes on the matrix class

Hinsen Konrad hinsenk@ere.umontreal.ca
Thu, 2 Nov 1995 10:27:10 -0500

   You can always define methods equal, greater and less, where
   a.greater(b) = [0,0,1] in your example.

But more complicated logical expressions with such a syntax become
impossible to read. In fact, I'd rather write a comparison using
map() and a lambda form if it weren't so inefficient.

The current state of comparisons in Python is extremely dangerous,
because comparisons always succeed even if they don't make any
sense. The worst consequence is that max() and min() always return a
result of the expected type, but which is usually not what the user
thinks it is. A perfect source for hard-to-find user errors. Of course
that could be fixed by just disallowing comparisons of non-comparable
objects, which however still does not solve the matrix comparison

Just an unfinished idea: would it be possible to construct a "matrix
expression evaluator" similar in syntax to map(), but efficient?

Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)

MATRIX-SIG  - SIG on Matrix Math for Python

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