Skip to content
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

gh-129027: Raise DeprecationWarning for sys._clear_type_cache #129043

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

srinivasreddy
Copy link
Contributor

@srinivasreddy srinivasreddy commented Jan 20, 2025

Lib/test/test_sys.py Outdated Show resolved Hide resolved
Lib/test/test_sys.py Outdated Show resolved Hide resolved
Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys._clear_type_cache is used in other tests as well which will now raise a DeprecationWarning. I think we should suppress the warnings in the relevant tests (or maybe switch to sys._clear_internal_caches()? though that might make backporting tests to 3.12 more difficult since the function was added in 3.13)

Python/sysmodule.c Outdated Show resolved Hide resolved
@tomasr8
Copy link
Member

tomasr8 commented Jan 20, 2025

This will also require a news entry :)

@srinivasreddy
Copy link
Contributor Author

srinivasreddy commented Jan 21, 2025

@tomasr8 Addressed in c532328

Lib/test/test_sys.py Outdated Show resolved Hide resolved
Lib/test/test_type_cache.py Outdated Show resolved Hide resolved
Python/sysmodule.c Outdated Show resolved Hide resolved
Python/sysmodule.c Outdated Show resolved Hide resolved
Python/sysmodule.c Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
Raise DeprecationWarning for :func:`sys._clear_type_cache`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also have a What's New entry as well, not just a NEWS entry. You could also mention that this function was deprecated since 3.13 but didn't raise a deprecation warning at runtime.

Co-authored-by: Bénédikt Tran <[email protected]>
Python/sysmodule.c Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants