Skip to content

Commit 0cdc5c8

Browse files
skirpichevhugovkerlend-aaslandvstinner
authored
gh-119613: Soft deprecate Py_IS_NAN/INFINITY/FINITE (#119701)
Co-authored-by: Hugo van Kemenade <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
1 parent 016a46a commit 0cdc5c8

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@ Porting to Python 3.14
231231
Deprecated
232232
----------
233233

234+
* Macros :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY`
235+
and :c:macro:`!Py_IS_FINITE` are :term:`soft deprecated`,
236+
use instead :c:macro:`!isnan`, :c:macro:`!isinf` and
237+
:c:macro:`!isfinite` available from :file:`math.h`
238+
since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)
239+
234240
Removed
235241
-------
236242

Include/pymath.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@
2929

3030
// Py_IS_NAN(X)
3131
// Return 1 if float or double arg is a NaN, else 0.
32+
// Soft deprecated since Python 3.14, use isnan() instead.
3233
#define Py_IS_NAN(X) isnan(X)
3334

3435
// Py_IS_INFINITY(X)
3536
// Return 1 if float or double arg is an infinity, else 0.
37+
// Soft deprecated since Python 3.14, use isinf() instead.
3638
#define Py_IS_INFINITY(X) isinf(X)
3739

3840
// Py_IS_FINITE(X)
3941
// Return 1 if float or double arg is neither infinite nor NAN, else 0.
42+
// Soft deprecated since Python 3.14, use isfinite() instead.
4043
#define Py_IS_FINITE(X) isfinite(X)
4144

4245
// Py_INFINITY: Value that evaluates to a positive double infinity.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Macros ``Py_IS_NAN``, ``Py_IS_INFINITY`` and ``Py_IS_FINITE``
2+
are :term:`soft deprecated`.

0 commit comments

Comments
 (0)