[Cython] calling gmp automatically

Stefan Behnel stefan_ml at behnel.de
Tue Dec 23 13:53:36 CET 2008


Hi,

Ondrej Certik wrote:
> currently Cython converts all "ints" as int32 in C (right?).

Depends on what you mean with "ints". Python ints are Python objects. Only
things defined "cdef int" will become C ints.


> How difficult would be to improve Cython, so that it can automatically
> convert all ints to gmp calls, so that one can use arbitrary integers?
>
> Or to put the question differently, obviously, for most of my codes I
> just need int32 and enjoy the speedups. However, sometimes it's handy
> to use arbitrary ints, and since in Python both of it is just "int"
> (resp. long in py2.6) --- what is the best way to have both?

We have special support for NumPy (and buffer objects in general), so I
wouldn't mind getting special support for other common high-performance
libraries in as well. However, I'm not sure what we could do more than
what gmpy already does.

Stefan



More information about the Cython-dev mailing list