Doc/library/sys.rst says sys._clear_type_cache() clears the internal type cache, and that sys._clear_internal_caches() clears all internal performance-related caches. Neither does any more. Both reach it only through PyType_ClearCache(), which is now just return NEXT_VERSION_TAG(interp) - 1;.
cached: (1, 'v', 131161)
after sys._clear_type_cache: (1, 'v', 131161)
after sys._clear_internal_caches: (1, 'v', 131161)
The C API side is already documented. Doc/c-api/type.rst says the function is now a no-op, and GH-150160 added a matching porting note. The Python wrappers look like the spot that was missed.
Activity
kumaraditya303 commented on Aug 18, 2026
sys._clear_type_cache is already deprecated for removal, I think we should remove it as it is no-op now.
gh-155354: Document that `sys._clear_type_cache` no longer clears the…