[Numpy-discussion] Extensive use of methods instead of functions

Konrad Hinsen hinsen at cnrs-orleans.fr
Fri Jan 24 12:13:05 CST 2003


José Fonseca <j_r_fonseca at yahoo.co.uk> writes:

> With the ability of subclassing types in recent versions of the Python
> language, more people will be interested in subclassing Numeric arrays
> for specific purposes.  Still the use of functions instead of methods
> takes away many of the advantages, the ability of being overloaded.

True. On the other hand, there is also an advantage: NumPy routines
can be used on standard Python data types such as number and sequence
types.

In the ideal world (which might come one day), core NumPy
functionality would be part of standard Python, and then all these
operations would work on other built-in types as well.

Until then, I am not sure that changing NumPy functions to methods
is a good idea. I need to call them on scalar numbers much more
often than I subclass arrays.

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 Numpy-discussion mailing list