Skip to content

Commit cca7f38

Browse files
committed
[3.14] pythongh-143331: Schedule to remove format "N" for Decimal (pythonGH-143372)
(cherry picked from commit dd750b3) Co-authored-by: Semyon Moroz <[email protected]>
1 parent 6b836ca commit cca7f38

File tree

5 files changed

+20
-1
lines changed

5 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-future.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: 5 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`:
@@ -2025,6 +2026,10 @@ New Deprecations
20252026

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

2029+
.. include:: ../deprecations/pending-removal-in-3.18.rst
2030+
2031+
.. include:: ../deprecations/pending-removal-in-3.19.rst
2032+
20282033
.. include:: ../deprecations/pending-removal-in-future.rst
20292034

20302035
CPython Bytecode Changes

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-future.rst

Modules/_decimal/_decimal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3552,7 +3552,8 @@ dec_format(PyObject *dec, PyObject *args)
35523552

35533553
if (size > 0 && fmt[size-1] == 'N') {
35543554
if (PyErr_WarnEx(PyExc_DeprecationWarning,
3555-
"Format specifier 'N' is deprecated", 1) < 0) {
3555+
"Format specifier 'N' is deprecated and "
3556+
"slated for removal in Python 3.18", 1) < 0) {
35563557
return NULL;
35573558
}
35583559
}

0 commit comments

Comments
 (0)