Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3622 by [email protected]: Support for gmpy and gmpy2.
http://code.google.com/p/sympy/issues/detail?id=3622

I've attached a patch file for the changes I made to support gmpy and gmpy2. (I'm still trying to figure out git....).

With these changes, gmpy 1.13 or later and gmpy2 2.0.0b4 or later should work. I discovered a bug in gmpy2 so I will be releasing b4 in a few days.

Summary of the changes;
sympy.core.compatibility tries importing both gmpy2 and gmpy and checks for the correct version. HAS_GMPY is set to 2 if a valid version of gmpy2 is found. It is set to 1 if a valid version of gmpy is found. And it is set to 0 if no valid version is found.

The check for the requested ground type is also done in sympy.core.compatibility so GROUND_TYPES should be imported from there.

I also added SYMPY_INTS to sympy.core.compatibility. It is a tuple that contains the valid integer types, taking into account the Python version and the requested ground type.

I made the following changes to account for the changes in gmpy2. They are backwards compatible to gmpy 1.13.
- changed mpq.numer() to mpq.numerator
- changed mpq.denom() to mpq.denominator
- changed the uses of qdiv() to use gmpy.qdiv(a,b) instead of a.qdiv(b)
- changed various type checks to use SYMPY_INTS

Attachments:
        0001-Changes-to-support-gmpy-1.13-or-later-or-gmpy2-2.0.0.patch  20.9 KB

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to