[PYTHON MATRIX-SIG] More thoughts on comparsion operators.

Konrad Hinsen hinsen@ibs.ibs.fr
Thu, 24 Oct 96 12:48:51 +0100


> I thought I might be able to use this to make ordered comparisons a
> little safer. That is, to raise exceptions for ordered comparisons that
> make no sense instead of returning an arbitrary value. In particular,
> I was thinking of >, <, etc. on matrices. However this also applies to
> other cases such as comparing strings to ints.

I think we all agree that this is an important point and should be
taken care of. As for the suitability of your solution, well, I don't
particularly like messing around with things like INT_MIN.

Would it be much more work to use a more clearly non-comparison return
value for "not equal"? Perhaps None in Python code and a null pointer
in C code?

> Did you actually read this far? I'm impressed!!!! Well here's the
> patches. Let me know if you think they're interesting / useful.

Whatever a final solution will look like, your patches are interesting
just for personal use as a debugging aid. Thanks!

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-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
=================