gmp module

Alex Martelli aleaxit at
Mon Nov 6 12:11:19 CET 2000

"mary" <mary at> wrote in message
news:8u5tua$rie$1 at
> Hi,
> is someone working on a python gmp module.

Yes!  I am.

> The gmpmodule and mpz modules are too old and
> are no longer maintained.

Yep.  That's why I started working on a new
module (starting from gmpmodule sources), in
particular in order to supply to PySymbolic
speedy numerical support.  Intended name 'gmpy'. has been granted,
but I haven't uploaded anything to it yet
(haven't had time to work on it over the
last two weeks).

The .C sources I currently have offer pre-alpha
level support for mpz and mpf entities only
(no mpq's yet).  They do build on Windows,
thanks to a binary GMP.LIB I've found on the
net that supports Visual C++; I can only develop
on Windows at this time, unfortunately.  But
Pearu Peterson, PySymbolic's author, kindly
supplied the small fixes to make it work for
him on his Unix machine, too.  There is one
known bug (perhaps with the GMP.LIB I'm using?)
with the test-for-perfect-power function -- I
don't know if it shows up on Unix, too.

There are some design issues, such as -- should
gmpy objects be immutable (for conceptual
compatibility with builtin numbers) or mutable
(for efficiency)?  Should the whole module be
built with C (for maximum portability and
minimal binary-size) or C++ (e.g. py_cpp) for
max programmer-productivity and to gain nice
extras such as being able to inherit from the
objects the module exports...?  I intend to open
discussion-lists on the sourceforge site, but
feedback on this group is also welcome (most
particularly since I _haven't_ yet set up the
site in question...:-).


More information about the Python-list mailing list