8000 bpo-40759: Deprecate the symbol module (GH-20364) · python/cpython@96d9107 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96d9107

Browse files
bpo-40759: Deprecate the symbol module (GH-20364)
Automerge-Triggered-By: @pablogsal (cherry picked from commit cf88871) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
1 parent cdb015b commit 96d9107

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

Doc/library/symbol.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ the definitions of the names in the context of the language grammar. The
1717
specific numeric values which the names map to may change between Python
1818
versions.
1919

20+
.. warning::
21+
22+
The symbol module is deprecated and will be removed in future versions of
23+
Python.
24+
2025
This module also provides one additional data object:
2126

2227

Doc/whatsnew/3.9.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,10 @@ Deprecated
692692
Python versions it will raise a :exc:`TypeError` for all floats.
693693
(Contributed by Serhiy Storchaka in :issue:`37315`.)
694694

695-
* The :mod:`parser` module is deprecated and will be removed in future versions
696-
of Python. For the majority of use cases, users can leverage the Abstract Syntax
697-
Tree (AST) generation and compilation stage, using the :mod:`ast` module.
695+
* The :mod:`parser` and :mod:`symbol` modules are deprecated and will be
696+
removed in future versions of Python. For the majority of use cases,
697+
users can leverage the Abstract Syntax Tree (AST) generation and compilation
698+
stage, using the :mod:`ast` module.
698699

699700
* Using :data:`NotImplemented` in a boolean context has been deprecated,
700701
as it is almost exclusively the result of incorrect rich comparator

Lib/symbol.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
#
1212
# make regen-symbol
1313

14+
import warnings
15+
16+
warnings.warn(
17+
"The symbol module is deprecated and will be removed "
18+
"in future versions of Python",
19+
DeprecationWarning,
20+
stacklevel=2,
21+
)
22+
1423
#--start constants--
1524
single_input = 256
1625
file_input = 257
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate the :mod:`symbol` module.

0 commit comments

Comments
 (0)
0