gh-141004: soft-deprecate Py_INFINITY macro (#141033)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Sergey B Kirpichev 2025-11-12 15:44:49 +03:00 committed by GitHub
parent c6f3dd6a50
commit e2026731f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 45 additions and 36 deletions

View file

@ -150,7 +150,7 @@ special_type(double d)
#define P14 0.25*Py_MATH_PI
#define P12 0.5*Py_MATH_PI
#define P34 0.75*Py_MATH_PI
#define INF Py_INFINITY
#define INF INFINITY
#define N Py_NAN
#define U -9.5426319407711027e33 /* unlikely value, used as placeholder */
@ -1186,11 +1186,11 @@ cmath_exec(PyObject *mod)
if (PyModule_Add(mod, "tau", PyFloat_FromDouble(Py_MATH_TAU)) < 0) {
return -1;
}
if (PyModule_Add(mod, "inf", PyFloat_FromDouble(Py_INFINITY)) < 0) {
if (PyModule_Add(mod, "inf", PyFloat_FromDouble(INFINITY)) < 0) {
return -1;
}
Py_complex infj = {0.0, Py_INFINITY};
Py_complex infj = {0.0, INFINITY};
if (PyModule_Add(mod, "infj", PyComplex_FromCComplex(infj)) < 0) {
return -1;
}