Skip to content

gh-118418: Deprecate failing to pass a value to the *type_params* parameter of some private typing APIs #118695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2024

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented May 7, 2024

These are undocumented, private functions, but there's unfortunately widespread usage of them in third-party libraries. Even if we provide a new public API for people to use in Python 3.14, it will take a while for third-party libraries to migrate to the new API. In the meantime, they may get incorrect behaviour if they fail to pass in a value to the type_params parameter. So let's warn them about that.

Closes #118418

@AlexWaygood AlexWaygood enabled auto-merge (squash) May 7, 2024 10:56
@AlexWaygood
Copy link
Member Author

Thanks both for the reviews!

@AlexWaygood AlexWaygood merged commit 0f8a07d into python:main May 7, 2024
35 checks passed
@AlexWaygood AlexWaygood deleted the type-params-depr branch May 7, 2024 11:12
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
@alexmojaki
Copy link

Should this be backported to 3.12?

@JelleZijlstra
Copy link
Member

No, we don't backport deprecations.

@AlexWaygood
Copy link
Member Author

Should this be backported to 3.12?

No, we shouldn't introduce new deprecation warnings in patch releases. Lots of projects use -Werror in CI; adding a deprecation warning in a patch release would mean their tests might suddenly start failing when they upgraded to the latest version of Python 3.12. That would be a really bad outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: _eval_type() missing 1 required positional argument: 'type_params' with import module
5 participants