Skip to content

bpo-40759: Deprecate the symbol module #20364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Doc/library/symbol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:


Expand Down
7 changes: 4 additions & 3 deletions Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,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
Expand Down
9 changes: 9 additions & 0 deletions Lib/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate the :mod:`symbol` module.