Skip to content

Promote ast node constructor deprecation warnings to errorsย #137600

@brianschubert

Description

@brianschubert

Feature or enhancement

Following from #105858

Several ast deprecations were introduced in 3.13, with errors scheduled for 3.15:

>>> _ = ast.Module(foo=1)
<python-input-1>:1: DeprecationWarning: Module.__init__ got an unexpected keyword argument 'foo'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.
Module(body=[], type_ignores=[])

>>> _ = ast.BinOp()
<python-input-2>:1: DeprecationWarning: BinOp.__init__ missing 1 required positional argument: 'right'. This will become an error in Python 3.15.
<python-input-2>:1: DeprecationWarning: BinOp.__init__ missing 1 required positional argument: 'op'. This will become an error in Python 3.15.
<python-input-2>:1: DeprecationWarning: BinOp.__init__ missing 1 required positional argument: 'left'. This will become an error in Python 3.15.

Now seems like a good time to promote these deprecation warnings to errors.

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)stdlibPython modules in the Lib dirtopic-parsertype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions