@@ -101,12 +101,16 @@ Node classes |
|
|
101 |
101 |
node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0), |
102 |
102 |
lineno=0, col_offset=0) |
103 |
103 |
|
|
104 |
+.. versionchanged:: 3.8 |
|
105 |
+ |
|
106 |
+ Class :class:`ast.Constant` is now used for all constants. |
|
107 |
+ |
104 |
108 |
.. deprecated:: 3.8 |
105 |
109 |
|
106 |
|
- Class :class:`ast.Constant` is now used for all constants. Old classes |
107 |
|
-:class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`, |
|
110 |
+ Old classes :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`, |
108 |
111 |
:class:`ast.NameConstant` and :class:`ast.Ellipsis` are still available, |
109 |
|
- but they will be removed in future Python releases. |
|
112 |
+ but they will be removed in future Python releases. In the meanwhile, |
|
113 |
+ instantiating them will return an instance of a different class. |
110 |
114 |
|
111 |
115 |
|
112 |
116 |
.. _abstract-grammar: |