aleaxit / gmpy

General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)
https://gmpy2.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
516 stars 87 forks source link

Fix CI on CPython 3.13 due to difference _decimal/_pydecimal #483

Closed skirpichev closed 4 months ago

casevh commented 4 months ago

Thanks for fixing these issues. It's getting hard to keep up with all the changes just required to keep building wheels.

skirpichev commented 4 months ago

@casevh, please let me know if something else blocks first beta release or #475.

casevh commented 4 months ago

@skirpichev I'm only aware of one minor issue with 3.13. Here is an example:

int('11') is int('11') True int(mpz('11')) is int(mpz('11')) False

I think the fix is in GMPy_PyLong_From_MPZ. It should first check if an mpz can be converted to a C long or ssize_t and use the appropriate PyLong_FromLong() or PyLong_FromSsize_t(). I haven't check the CPython source code, but this should allow interning to work and support creation of compact values.

I could do a beta release without this fix. With this fix I would jump to rc1 status. Then I would do a joint release of 2.1.6 source and 2.2.0rc1 with source and wheels.

BTW, the fix for CPU detection resulted in a 10 to 15% improvement in multiplication performance.

skirpichev commented 4 months ago

I'm only aware of one minor issue with 3.13.

Hmm, this is broken on 3.12 and 3.11 as well.

I could do a beta release without this fix.

No, I think we should fix this. I will take a look today.