https://github.com/python/cpython/commit/dd750b348501247d458ea8d454213d4959a8f8b9
commit: dd750b348501247d458ea8d454213d4959a8f8b9
branch: main
author: Semyon Moroz <[email protected]>
committer: hugovk <[email protected]>
date: 2026-01-06T15:12:05+02:00
summary:
gh-143331: Schedule to remove format "N" for Decimal (#143372)
files:
A Doc/deprecations/pending-removal-in-3.18.rst
M Doc/deprecations/index.rst
M Doc/whatsnew/3.13.rst
M Doc/whatsnew/3.14.rst
M Doc/whatsnew/3.15.rst
M Modules/_decimal/_decimal.c
diff --git a/Doc/deprecations/index.rst b/Doc/deprecations/index.rst
index f3cecb321d633f..c91c64a1092457 100644
--- a/Doc/deprecations/index.rst
+++ b/Doc/deprecations/index.rst
@@ -7,6 +7,8 @@ Deprecations
.. include:: pending-removal-in-3.17.rst
+.. include:: pending-removal-in-3.18.rst
+
.. include:: pending-removal-in-3.19.rst
.. include:: pending-removal-in-3.20.rst
diff --git a/Doc/deprecations/pending-removal-in-3.18.rst
b/Doc/deprecations/pending-removal-in-3.18.rst
new file mode 100644
index 00000000000000..3e799219478424
--- /dev/null
+++ b/Doc/deprecations/pending-removal-in-3.18.rst
@@ -0,0 +1,9 @@
+Pending removal in Python 3.18
+------------------------------
+
+* :mod:`decimal`:
+
+ * The non-standard and undocumented :class:`~decimal.Decimal` format
+ specifier ``'N'``, which is only supported in the :mod:`!decimal` module's
+ C implementation, has been deprecated since Python 3.13.
+ (Contributed by Serhiy Storchaka in :gh:`89902`.)
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index dc105156f33080..3be6dcb3eacad2 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -1861,6 +1861,7 @@ New Deprecations
* Deprecate the non-standard and undocumented :class:`~decimal.Decimal`
format specifier ``'N'``,
which is only supported in the :mod:`!decimal` module's C implementation.
+ Scheduled to be removed in Python 3.18.
(Contributed by Serhiy Storchaka in :gh:`89902`.)
* :mod:`dis`:
@@ -2024,6 +2025,8 @@ New Deprecations
.. include:: ../deprecations/pending-removal-in-3.17.rst
+.. include:: ../deprecations/pending-removal-in-3.18.rst
+
.. include:: ../deprecations/pending-removal-in-3.19.rst
.. include:: ../deprecations/pending-removal-in-3.20.rst
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index c12a1920b10722..d4517183d697f1 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -2718,6 +2718,8 @@ New deprecations
.. include:: ../deprecations/pending-removal-in-3.17.rst
+.. include:: ../deprecations/pending-removal-in-3.18.rst
+
.. include:: ../deprecations/pending-removal-in-3.19.rst
.. include:: ../deprecations/pending-removal-in-3.20.rst
diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst
index 39d6fb6572c834..17415f888b65a2 100644
--- a/Doc/whatsnew/3.15.rst
+++ b/Doc/whatsnew/3.15.rst
@@ -1171,6 +1171,8 @@ New deprecations
.. include:: ../deprecations/pending-removal-in-3.17.rst
+.. include:: ../deprecations/pending-removal-in-3.18.rst
+
.. include:: ../deprecations/pending-removal-in-3.19.rst
.. include:: ../deprecations/pending-removal-in-3.20.rst
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index e183c70653b0d4..33e624e342eaee 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3764,7 +3764,8 @@ _decimal_Decimal___format___impl(PyObject *dec,
PyTypeObject *cls,
if (size > 0 && fmt[size-1] == 'N') {
if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "Format specifier 'N' is deprecated", 1) < 0) {
+ "Format specifier 'N' is deprecated and "
+ "slated for removal in Python 3.18", 1) < 0) {
return NULL;
}
}
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]