Skip to content

Promote ast node constructor deprecation warnings to errors #137600

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

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)stdlibStandard Library Python modules in the Lib/ directorytopic-parsertype-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions