simple symbolic math in Python

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Jan 8 05:32:22 EST 2001


kragen at dnaco.net (Kragen Sitaker) writes:

> I'm running into a problem: I can overload unary minus, but I can't
> overload e.g. math.sin and math.cos, because they're not methods.  It

Right. However, if you have NumPy, you can override the math functions
in Numeric, which are the ones that NumPy users prefer anyway (because
they support arrays). Just define methods sin, cos, ... in your
class.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



More information about the Python-list mailing list