You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 3.13 we changed ast.dump() to not show empty values (None or the empty list) by default. However, this is based purely on the value of individual attributes:
Instead, this logic should look at the node's _field_types and use the same logic we use to determine whether to allow omitting the argument in calls to the constructor: elide None if the type is a union including None, elide [] if the type is a list, and elide Load() if the type is an expr_context.
Bug report
Bug description:
In 3.13 we changed
ast.dump()to not show empty values (Noneor the empty list) by default. However, this is based purely on the value of individual attributes:Instead, this logic should look at the node's
_field_typesand use the same logic we use to determine whether to allow omitting the argument in calls to the constructor: elide None if the type is a union including None, elide[]if the type is a list, and elideLoad()if the type is an expr_context.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs