]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40759: Deprecate the symbol module (GH-20364)
authorBatuhan Taskaya <batuhanosmantaskaya@gmail.com>
Sun, 31 May 2020 22:01:50 +0000 (01:01 +0300)
committerGitHub <noreply@github.com>
Sun, 31 May 2020 22:01:50 +0000 (15:01 -0700)
Automerge-Triggered-By: @pablogsal
Doc/library/symbol.rst
Doc/whatsnew/3.9.rst
Lib/symbol.py
Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst [new file with mode: 0644]

index 44996936e2d28f85535ebd61b57e15d515ea6d18..d56600af29d6e2ee0409918a30c2be5326260073 100644 (file)
@@ -17,6 +17,11 @@ the definitions of the names in the context of the language grammar.  The
 specific numeric values which the names map to may change between Python
 versions.
 
+.. warning::
+
+   The symbol module is deprecated and will be removed in future versions of
+   Python.
+
 This module also provides one additional data object:
 
 
index 7f81074b2b55feb00251c5c33639136110316fa8..6ace7a4253f1826b6d9b25b6de519a7e1546ca5a 100644 (file)
@@ -692,9 +692,10 @@ Deprecated
   Python versions it will raise a :exc:`TypeError` for all floats.
   (Contributed by Serhiy Storchaka in :issue:`37315`.)
 
-* The :mod:`parser` module is deprecated and will be removed in future versions
-  of Python. For the majority of use cases, users can leverage the Abstract Syntax
-  Tree (AST) generation and compilation stage, using the :mod:`ast` module.
+* The :mod:`parser` and :mod:`symbol` modules are deprecated and will be
+  removed in future versions of Python. For the majority of use cases,
+  users can leverage the Abstract Syntax Tree (AST) generation and compilation
+  stage, using the :mod:`ast` module.
 
 * Using :data:`NotImplemented` in a boolean context has been deprecated,
   as it is almost exclusively the result of incorrect rich comparator
index 36e0eec7ac1f5df02a51a69c67357df2d9509243..aaac8c914431bb80242adcf65dd92a6c37af55f3 100644 (file)
 #
 #    make regen-symbol
 
+import warnings
+
+warnings.warn(
+    "The symbol module is deprecated and will be removed "
+    "in future versions of Python",
+    DeprecationWarning,
+    stacklevel=2,
+)
+
 #--start constants--
 single_input = 256
 file_input = 257
diff --git a/Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst b/Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst
new file mode 100644 (file)
index 0000000..e77da3a
--- /dev/null
@@ -0,0 +1 @@
+Deprecate the :mod:`symbol` module.