[MATRIX-SIG] umathmodule and exceptions

Shashank Mallick mallick@hks.com
Thu, 19 Feb 1998 12:22:45 -0500


Hello,

I'm using the umath module to perform numerical computations on user-defined
types. I ran into the following behavior, which I feel is a bug in the umath
module.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$python
Python 1.5 (#5, Feb 11 1998, 17:58:28) [C] on irix6
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> class test:
...    pass
...
>>> import math
>>> math.cos(test)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation
>>> import umath
WARNING: Python C API version mismatch for module umath:
  This Python has API version 1007, module umath has version 1006.
>>> umath.cos(test)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: cos
>>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is clearly a TypeError and I see no reason why an AttributeError is raised
when I perform this operation.

Any comments?

Thanks a lot,
Shashank

-- 
  Shashank
    Hibbitt, Karlsson & Sorensen, Inc.        e-mail : mallick@hks.com
    1080 Main Street                          tel    :  (401) 727 4200
    Pawtucket, RI 02860                       fax    :  (401) 727 4208



_______________
MATRIX-SIG  - SIG on Matrix Math for Python

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