[MATRIX-SIG] umathmodule and exceptions

David Ascher da@skivs.ski.org
Thu, 19 Feb 1998 09:52:11 -0800 (PST)


> I'm pretty sure that cos is an attribute of the umath module:

Found the problem.  umath.cos is smarter than I realized, and will call a
method of a class instance if found.  Witness:

>>> class A:
...     def cos(self):
...             return 1.0
...
>>> umath.cos(A())
1.0

So it is an attribute error (your class had no 'cos' method defined), but
I agree the error message could be more informative.

Hope this helps.

--da


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

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