[Numpy-discussion] Increased polymorphism?

Magnus Lie Hetland magnus at hetland.org
Sat Dec 28 14:35:02 EST 2002

I know PyObject arrays aren't supported in numarray yet -- but how
about making the functions more polymorphic? Yes, they work on other
sequence types such as lists -- but there seems to be quite a bit of
type checking going on. I suppose that is necessary for performance
reasons, but how about some polymorphic behaviour in the cases where
an unknown type is encountered?

It would be nice, for example, if sum() worked on general iterators
and generators, and if argsort() worked on, e.g., lists of strings...
This would make it easier to integrate the purely numeric stuff with
other parts of Python programs...

It may be that I'm going beyond the scope of numarray here, but this
sort of agnostic signature-based polymorphism is very Pythonic.

Magnus Lie Hetland

More information about the NumPy-Discussion mailing list