[SciPy-user] Type handling of matrices

Fernando Perez Fernando.Perez at colorado.edu
Thu Nov 11 02:51:45 CST 2004

Pearu Peterson wrote:

> Methods (not attributes) A.is<property> can be defined for sparse 
> matrices, in fact, sparse.spmatrix should take advantage of using
> these properties.
> For full matrices, is<property> must probably be a function as we cannot
> change Numeric of numarray in this way (unless we subclass Matrix). They 
> can be implemented in scipy_base/matrix_base.py, for instance.

How about just using functions for everything?  I'd really hate to have to 
remember that if A is sparse, A.is<foo> works, but if it's dense I need to 
instead use is<foo>(A).

Another alternative would be to suggest these modifications be made to 
numarray proper, if the method approach appears preferable.

But I'd really like to vote for a _single_ syntax for property queries. 
Ultimately which one doesn't matter that much to me, but I don't want to see 
two different syntaxes for the same thing.



More information about the SciPy-user mailing list