about presicion

Alex Martelli aleaxit at yahoo.com
Tue Aug 31 07:00:32 EDT 2004


mensanator at aol.com <mensanator at aol.com> wrote:
   ...
> > > I just tried it and found out it's not compatible with gmpy.
> >
> > By "it" do you mean Decimal, or Python 2.4 alpha 2?
> 
> By "it", I meant gmpy 1.0 and Python 2.4. Trying to import the
> module says it can't use the Python23.dll.

_Any_ binary extension Python module compiled for Python 2.3 cannot even
load (on Windows) with Python 2.4 -- this has always been true on
Windows between any two releases of Python and will presumably continue
to be so for the foreseeable future.

This doesn't mean that Python 2.4 "is not compatible with gmpy" or
viceversa: it just means you obviously need to use a gmpy binary (pyd
file) compiled for the version of Python you're using.  Just as it would
be the case for any other binary extension module whatsoever.

Unfortunately, compiling any binary extension module on Windows for
Python 2.4 requires Microsoft's very latest C++ compiler -- I do not own
a copy, nor do I have any PC normally running Windows XP, which is
required to run that compiler.  Until Pyhon 2.3, I made do with a
Windows 98 session running under win4lin on one of my Linux machines,
and good old Microsoft Visual C++ 6 -- but such limited resources are
not sufficient any longer to compile Python binary extension modules for
Python 2.4.  Since in terms of income-making (as well as leisure;-) I
work by now only on MacOSX, Linux, and OpenBSD machines, I am not going
to buy a PC loaded with Microsoft software just to be able to donate
precompiled Python binary extension modules to Windows users.


> > I think gmpy should
> > build happily with the latter,
> 
> I'm using the pre-built Windows binary distribution. I wouldn't
> know how to re-build it. I assume that when Python 2.4 is final,
> I newer compatible version of gmpy will become available.

Not by magic -- I hope somebody out there owns all the needed Microsoft
software and is interested in compiling gmpy for Windows under Python
2.4 and making it available, but it won't be me.


> > and interoperate sensibly with Decimal
> > anyway -- as gmpy's author I'd be quite happy to fix gmpy if it's
> broken
> > in either respect.
> 
> Were you aware that there is apparently a memory leak in the
> gmpy.divm() function? Calling it several million time caused my
> computer to run out of virtual memeory. Luckily, I was able to
> work around it using the gmpy.invert() which didn't consume any
> memory regardless of how many times it was called.

No, I was not aware of that -- I'll look into it, thanks.


Alex



More information about the Python-list mailing list