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
{{ message }}
Repository navigation
Default expr_context parameters in ast to Load() #118851
In #105858, we changed the AST node constructors to raise a DeprecationWarning when any required fields are omitted. Optional fields default to None and list fields default to an empty list. In real-world usage, it emerges that it's often also useful to omit the ctx argument to various classes (Attribute, Subscript, Starred, Name, List, Tuple); its value often does not matter, and it's convenient to have it default to ast.Load().
I'd like to backport this to 3.13 since it helps undo a noisy DeprecationWarning.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
pythongh-118851: Default ctx arguments to AST constructors to Load()
gh-118851: Default ctx arguments to AST constructors to Load() (#118854)
pythongh-118851: Default ctx arguments to AST constructors to Load() (p…
[3.13] gh-118851: Default ctx arguments to AST constructors to Load() (…
pythongh-118851: Default ctx arguments to AST constructors to Load() (p…