[PYTHON MATRIX-SIG] Type coercion two more times

David Ascher da@maigret.cog.brown.edu
Fri, 26 Jan 1996 12:03:29 -0500 (EST)

>       having to explain the following to potential Python array users:
>       >>> pi = omath.arctan(1.0)*4.0
>       >>> m = Array_f([1.0,2.0,3.0])
>       >>> m * pi
>       Traceback (innermost last):
> 	File "<stdin>", line 1, in ?
>       TypeError: inconsistant floating point types
>    It could be made a bit easier by changing the text of the
>    error message:
>       TypeError: no automatic coercion between precisions

I have no idea whether this is possible or not, but one area where I
think Python needs help is the detail of the exceptions.  For example,
would it be possible at all to have at least the two uncoercable types
listed ("first argument is a single precision float, second argument is
a double precision float")?


PS: This doesn't have to be in the next release, just something to keep
in mind.  A certain set of users at least will want to use the array
tool in an interactive context, where these things matter a lot.

MATRIX-SIG  - SIG on Matrix Math for Python

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