We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad273f7 commit ac2fff4Copy full SHA for ac2fff4
Doc/library/ast.rst
@@ -134,6 +134,14 @@ Node classes
134
Simple indices are represented by their value, extended slices are
135
represented as tuples.
136
137
+.. versionchanged:: 3.13
138
+
139
+ AST node constructors were changed to provide sensible defaults for omitted
140
+ fields: optional fields now default to ``None``, list fields default to an
141
+ empty list, and fields of type :class:`!ast.expr_context` default to
142
+ :class:`Load() <ast.Load>`. Previously, omitted attributes would not exist on constructed
143
+ nodes (accessing them raised :exc:`AttributeError`).
144
145
.. versionchanged:: 3.14
146
147
The :meth:`~object.__repr__` output of :class:`~ast.AST` nodes includes
0 commit comments