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
510 stars 86 forks source link

Amend b2236fc #410

Closed skirpichev closed 1 year ago

skirpichev commented 1 year ago

This fix int(mpz(0)) for CPython versions < 3.12

skirpichev commented 1 year ago

2nd commit is from #409

casevh commented 1 year ago

Thanks. This fixed an issue I found running the mpmath test suite.

Case

skirpichev commented 1 year ago

This fixed an issue I found running the mpmath test suite.

Same for me. I was working on #353.

I think we should use the hypothesis in test_mpz_conversion() to test int(mpz(int))==int invariant.