Skip to content

Commit 04a233e

Browse files
committed
gh-141004: deprecate Py_MATH_El and Py_MATH_PIl macros
1 parent 947bb46 commit 04a233e

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

Doc/deprecations/c-api-pending-removal-in-3.20.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ Pending removal in Python 3.20
55
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
66
to convert a Python complex number to/from the C :c:type:`Py_complex`
77
representation.
8+
9+
* Macros :c:macro:`!Py_MATH_PIl` and :c:macro:`!Py_MATH_El`.

Doc/whatsnew/3.15.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,10 @@ Deprecated C APIs
10681068
since 3.15 and will be removed in 3.17.
10691069
(Contributed by Nikita Sobolev in :gh:`136355`.)
10701070

1071+
* :c:macro:`!Py_MATH_El` and :c:macro:`!Py_MATH_PIl` are deprecated
1072+
since 3.15 and will be removed in 3.20.
1073+
(Contributed by Sergey B Kirpichev in :gh:`141004`.)
1074+
10711075

10721076
.. Add C API deprecations above alphabetically, not here at the end.
10731077

Include/pymath.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
/* High precision definition of pi and e (Euler)
88
* The values are taken from libc6's math.h.
99
*/
10+
// Deprecated since Python 3.15.
1011
#ifndef Py_MATH_PIl
1112
#define Py_MATH_PIl 3.1415926535897932384626433832795029L
1213
#endif
1314
#ifndef Py_MATH_PI
1415
#define Py_MATH_PI 3.14159265358979323846
1516
#endif
1617

18+
// Deprecated since Python 3.15.
1719
#ifndef Py_MATH_El
1820
#define Py_MATH_El 2.7182818284590452353602874713526625L
1921
#endif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:c:macro:`!Py_MATH_El` and :c:macro:`!Py_MATH_PIl` are deprecated.

0 commit comments

Comments
 (0)