summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-02-17 09:09:49 (GMT)
committerGitHub <noreply@github.com>2020-02-17 09:09:49 (GMT)
commit988aeba94bf1dab81dd52fc7b02dca7a57ea8ba0 (patch)
tree80d677a9224b3a331188f59883b6b41b95b9773b /Doc/library
parentea316fd21527dec53e704a5b04833ac462ce3863 (diff)
downloadcpython-988aeba94bf1dab81dd52fc7b02dca7a57ea8ba0.zip
cpython-988aeba94bf1dab81dd52fc7b02dca7a57ea8ba0.tar.gz
cpython-988aeba94bf1dab81dd52fc7b02dca7a57ea8ba0.tar.bz2
bpo-32892: Update the documentation for handling constants in AST. (GH-18514)
(cherry picked from commit 85a2eef473a2c9ed3ab9c6ee339891fe99adbbc9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/ast.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index a5dd0e1..80afbbc 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -101,12 +101,16 @@ Node classes
node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),
lineno=0, col_offset=0)
+.. versionchanged:: 3.8
+
+ Class :class:`ast.Constant` is now used for all constants.
+
.. deprecated:: 3.8
- Class :class:`ast.Constant` is now used for all constants. Old classes
- :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`,
+ Old classes :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`,
:class:`ast.NameConstant` and :class:`ast.Ellipsis` are still available,
- but they will be removed in future Python releases.
+ but they will be removed in future Python releases. In the meanwhile,
+ instantiating them will return an instance of a different class.
.. _abstract-grammar: