Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed the redundant whitespace
  • Loading branch information
MannXo committed Oct 17, 2025
commit ece522f33fdeca6f29507d399d64e2504c73cc32
12 changes: 6 additions & 6 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@
node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),
lineno=0, col_offset=0)

If a field that is optional in the grammar is omitted from the constructor,
it defaults to ``None``. If a list field is omitted, it defaults to the empty
list. If a field of type :class:`!ast.expr_context` is omitted, it defaults to
:class:`Load() <ast.Load>`. If any other field is omitted, a :exc:`DeprecationWarning` is raised
and the AST node will not have this field. In Python 3.15, this condition will
raise an error.
If a field that is optional in the grammar is omitted from the constructor,
it defaults to ``None``. If a list field is omitted, it defaults to the empty
list. If a field of type :class:`!ast.expr_context` is omitted, it defaults to
:class:`Load() <ast.Load>`. If any other field is omitted, a :exc:`DeprecationWarning` is raised
and the AST node will not have this field. In Python 3.15, this condition will
raise an error.

.. versionchanged:: 3.8

Expand All @@ -136,7 +136,7 @@

.. versionchanged:: 3.13

AST node constructors were changed to provide sensible defaults for omitted

Check warning on line 139 in Doc/library/ast.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:class reference target not found: ast.expr_context [ref.class]
fields: optional fields now default to ``None``, list fields default to an
empty list, and fields of type :class:`ast.expr_context` default to
Comment thread
ambv marked this conversation as resolved.
Outdated
:class:`Load() <ast.Load>`. Previously, omitted attributes would not exist on constructed
Expand Down
Loading