Python and generic programming
Jive Dadson
jdadson at yahoo.com
Sat Nov 20 02:09:52 EST 2004
Alex Martelli wrote:
>
> Roman Suzi <rnd at onego.ru> wrote:
>
> > I wonder, does Python support generic programming paradigm, and to what extent
>
> It appears to me to support generics at least as well as C++ does. I
> just write normal code (no typechecks) and voila, the equivalent of C++
> templates (at least). What do you think is missing?
>
> Alex
How about specialization? I'm relatively new to Python. I ask for
information, not to be argumentative.
If you have, for example, several data-types for matrices, how do you
write code that will automatically find the right routine for quickly
multiplying a vector by a diagonal matrix represented as a vector, and
automatically call the right code for multiplying by a sparse matrix
represented by some sparse coding, etc?
More information about the Python-list
mailing list