[PYTHON MATRIX-SIG] Type Coercion

Konrad HINSEN hinsenk@ere.umontreal.ca
Mon, 12 Feb 1996 14:11:33 -0500


   exception.  However, I would want the capability to turn on exceptions
   for those who want to identify unwanted coercions.  How could this be
   made an option similar to capabilities of numerical packages that can
   turn on/off traps on floating point exceptions?

The problem gets a bit more complicated by the fact that you might
want this check to be applied only to part of the code. For example,
you might want to do "precision debugging" on your code while using a
library that coerces happily between float and double. Such things are
best left to a debugger, which already has provisions for doing things
on specific code regions and under specific conditions. And Python
fortunately has a debugger.

For such an approach, the umath module should provide some hook to
register a function that is called in case of a float->double
coercion. This hook would then be used by an extended debugger.
The main question is: who is willing to look at and modify
the debugger?

-------------------------------------------------------------------------------
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
=================