]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143331: Schedule to remove format "N" for Decimal (#143372)
authorSemyon Moroz <donbarbos@proton.me>
Tue, 6 Jan 2026 13:12:05 +0000 (13:12 +0000)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 13:12:05 +0000 (15:12 +0200)
Doc/deprecations/index.rst
Doc/deprecations/pending-removal-in-3.18.rst [new file with mode: 0644]
Doc/whatsnew/3.13.rst
Doc/whatsnew/3.14.rst
Doc/whatsnew/3.15.rst
Modules/_decimal/_decimal.c

index f3cecb321d633fdfeeb13a6d90386a907f170db0..c91c64a109245728c1eb19ef74ec75af1f17bc72 100644 (file)
@@ -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 (file)
index 0000000..3e79921
--- /dev/null
@@ -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`.)
index dc105156f33080daad4e4198c4de46d96753e522..3be6dcb3eacad2749edb82fed35a85efaa144752 100644 (file)
@@ -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
index c12a1920b107226a52526bca906e6a4bce684c27..d4517183d697f1ff5bb284edff27685ad91adf97 100644 (file)
@@ -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
index 39d6fb6572c834b0dca08b231be75a9ac5080d2b..17415f888b65a2ba9ba23eb30ef224abcf535356 100644 (file)
@@ -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
index e183c70653b0d4505db2a0aca64716a8059f6e4b..33e624e342eaeebacbb16016fe6793f335f864ad 100644 (file)
@@ -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;
         }
     }