bpo-40759: Deprecate the symbol module (GH-20364)
https://github.com/python/cpython/commit/cf88871d6a9c12e7b7e5f4d65abc2ec6e2f... commit: cf88871d6a9c12e7b7e5f4d65abc2ec6e2fe952e branch: master author: Batuhan Taskaya <batuhanosmantaskaya@gmail.com> committer: GitHub <noreply@github.com> date: 2020-05-31T15:01:50-07:00 summary: bpo-40759: Deprecate the symbol module (GH-20364) Automerge-Triggered-By: @pablogsal files: A Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst M Doc/library/symbol.rst M Doc/whatsnew/3.9.rst M Lib/symbol.py diff --git a/Doc/library/symbol.rst b/Doc/library/symbol.rst index 44996936e2d28..d56600af29d6e 100644 --- a/Doc/library/symbol.rst +++ b/Doc/library/symbol.rst @@ -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: diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 7f81074b2b55f..6ace7a4253f18 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -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 diff --git a/Lib/symbol.py b/Lib/symbol.py index 36e0eec7ac1f5..aaac8c914431b 100644 --- a/Lib/symbol.py +++ b/Lib/symbol.py @@ -11,6 +11,15 @@ # # 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 index 0000000000000..e77da3ac3dfa9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-05-24-23-52-35.bpo-40759.DdZdaw.rst @@ -0,0 +1 @@ +Deprecate the :mod:`symbol` module.
participants (1)
-
Batuhan Taskaya