Skip to content

Commit dd750b3

Browse files
authored
gh-143331: Schedule to remove format "N" for Decimal (#143372)
1 parent efb4e6c commit dd750b3

File tree

6 files changed

+20
-1
lines changed

6 files changed

+20
-1
lines changed

Doc/deprecations/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Deprecations
77

88
.. include:: pending-removal-in-3.17.rst
99

10+
.. include:: pending-removal-in-3.18.rst
11+
1012
.. include:: pending-removal-in-3.19.rst
1113

1214
.. include:: pending-removal-in-3.20.rst
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Pending removal in Python 3.18
2+
------------------------------
3+
4+
* :mod:`decimal`:
5+
6+
* The non-standard and undocumented :class:`~decimal.Decimal` format
7+
specifier ``'N'``, which is only supported in the :mod:`!decimal` module's
8+
C implementation, has been deprecated since Python 3.13.
9+
(Contributed by Serhiy Storchaka in :gh:`89902`.)

Doc/whatsnew/3.13.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,7 @@ New Deprecations
18611861
* Deprecate the non-standard and undocumented :class:`~decimal.Decimal`
18621862
format specifier ``'N'``,
18631863
which is only supported in the :mod:`!decimal` module's C implementation.
1864+
Scheduled to be removed in Python 3.18.
18641865
(Contributed by Serhiy Storchaka in :gh:`89902`.)
18651866

18661867
* :mod:`dis`:
@@ -2024,6 +2025,8 @@ New Deprecations
20242025

20252026
.. include:: ../deprecations/pending-removal-in-3.17.rst
20262027

2028+
.. include:: ../deprecations/pending-removal-in-3.18.rst
2029+
20272030
.. include:: ../deprecations/pending-removal-in-3.19.rst
20282031

20292032
.. include:: ../deprecations/pending-removal-in-3.20.rst

Doc/whatsnew/3.14.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,6 +2718,8 @@ New deprecations
27182718

27192719
.. include:: ../deprecations/pending-removal-in-3.17.rst
27202720

2721+
.. include:: ../deprecations/pending-removal-in-3.18.rst
2722+
27212723
.. include:: ../deprecations/pending-removal-in-3.19.rst
27222724

27232725
.. include:: ../deprecations/pending-removal-in-3.20.rst

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,8 @@ New deprecations
11711171

11721172
.. include:: ../deprecations/pending-removal-in-3.17.rst
11731173

1174+
.. include:: ../deprecations/pending-removal-in-3.18.rst
1175+
11741176
.. include:: ../deprecations/pending-removal-in-3.19.rst
11751177

11761178
.. include:: ../deprecations/pending-removal-in-3.20.rst

Modules/_decimal/_decimal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3764,7 +3764,8 @@ _decimal_Decimal___format___impl(PyObject *dec, PyTypeObject *cls,
37643764

37653765
if (size > 0 && fmt[size-1] == 'N') {
37663766
if (PyErr_WarnEx(PyExc_DeprecationWarning,
3767-
"Format specifier 'N' is deprecated", 1) < 0) {
3767+
"Format specifier 'N' is deprecated and "
3768+
"slated for removal in Python 3.18", 1) < 0) {
37683769
return NULL;
37693770
}
37703771
}

0 commit comments

Comments
 (0)