]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-143331: Schedule to remove format "N" for Decimal (GH-143372) (#143476)
authorSemyon Moroz <donbarbos@proton.me>
Tue, 6 Jan 2026 13:58:29 +0000 (13:58 +0000)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 13:58:29 +0000 (15:58 +0200)
(cherry picked from commit dd750b348501247d458ea8d454213d4959a8f8b9)

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
Modules/_decimal/_decimal.c

index d064f2bec42c229225dfeccd73bdd234cab2632c..c891b0339916cb4421f7ae8b614c2f14133d8237 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-future.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 092af5aaa1c97a57f111c567a571553fefb9f916..44752d81e326067fa97295a97ed086162d127bd4 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`:
@@ -2025,6 +2026,10 @@ 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-future.rst
 
 CPython Bytecode Changes
index 5de419da57c74417eb2dd125e412aa6caea866bd..5a3c0977b7d124b87bc7c813098b602689bee38f 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-future.rst
index 4516c7d847bdedac65620ddcab0f0e52f1669e50..a7f12e1b291e0ec37cd48fc9048b490f7e34b5a0 100644 (file)
@@ -3552,7 +3552,8 @@ dec_format(PyObject *dec, PyObject *args)
 
         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;
             }
         }