Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.3k
Closed
Description
Documentation
In Python 3.13, AST node constructors now provide defaults for the omitted fields:
- Optional fields: default to
None - List fields: default to an empty list
expr_contextfields: default toLoad()
Previously in Python 3.12 and earlier, these omitted fields would not exist as attributes, causingAttributeError when accessed.
These information can be found inWhat’s New In Python 3.13, but not in theast documentation itself.
Since this is a significant behavioral change, it should be documented in theast module documentation with a.. versionchanged:: 3.13 directive.
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Todo