diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2024-05-26 12:34:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-26 12:34:48 (GMT) |
commit | 008bc04dcb3b1fa6d7c11ed8050467dfad3090a9 (patch) | |
tree | 57fde6c8cc110c90e801fc5c2bda9e7bba5928d4 /Doc/whatsnew | |
parent | b5b7dc98c94100e992a5409d24bf035d88c7b2cd (diff) | |
download | cpython-008bc04dcb3b1fa6d7c11ed8050467dfad3090a9.zip cpython-008bc04dcb3b1fa6d7c11ed8050467dfad3090a9.tar.gz cpython-008bc04dcb3b1fa6d7c11ed8050467dfad3090a9.tar.bz2 |
gh-119562: Remove AST nodes deprecated since Python 3.8 (#119563)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.14.rst | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 39172ac..bc12d4b 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -108,6 +108,36 @@ Deprecated Removed ======= +ast +--- + +* Remove the following classes. They were all deprecated since Python 3.8, + and have emitted deprecation warnings since Python 3.12: + + * :class:`!ast.Num` + * :class:`!ast.Str` + * :class:`!ast.Bytes` + * :class:`!ast.NameConstant` + * :class:`!ast.Ellipsis` + + Use :class:`ast.Constant` instead. As a consequence of these removals, + user-defined ``visit_Num``, ``visit_Str``, ``visit_Bytes``, + ``visit_NameConstant`` and ``visit_Ellipsis`` methods on custom + :class:`ast.NodeVisitor` subclasses will no longer be called when the + ``NodeVisitor`` subclass is visiting an AST. Define a ``visit_Constant`` + method instead. + + Also, remove the following deprecated properties on :class:`ast.Constant`, + which were present for compatibility with the now-removed AST classes: + + * :attr:`!ast.Constant.n` + * :attr:`!ast.Constant.s` + + Use :attr:`!ast.Constant.value` instead. + + (Contributed by Alex Waygood in :gh:`119562`.) + + argparse -------- |