Carl Witty wrote:
>
> I was hoping this would be powerful enough to write generic optimized
> mathematics code for Sage, but it doesn't do enough for that.

Let me hear your opinion on this though.

If this is implemented, one could move on to compile-time optimize away
isinstance in a few trivial cases. I.e you could do:

cdef generic gen_add(generic b, generic c):
    if isinstance(b, mpz_t):
        ...
    elif isinstance(b, ...

This would be a later addition, but a natural one and one that I would
like to have for NumPy (regardless on whether overloading on the argument
types is introduced as well). Would this solve your case?

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to