There was an error while loading. Please reload this page.
KeyWrapper
_functoolsmodule.c
1 parent 0d04b8d commit 2fd7246Copy full SHA for 2fd7246
2 files changed
Misc/NEWS.d/next/Core and Builtins/2022-09-07-13-38-37.gh-issue-96641.wky0Fc.rst
@@ -0,0 +1 @@
1
+Do not expose ``KeyWrapper`` in :mod:`_functools`.
Modules/_functoolsmodule.c
@@ -1471,9 +1471,8 @@ _functools_exec(PyObject *module)
1471
if (state->keyobject_type == NULL) {
1472
return -1;
1473
}
1474
- if (PyModule_AddType(module, state->keyobject_type) < 0) {
1475
- return -1;
1476
- }
+ // keyobject_type is used only internally.
+ // So we don't expose it in module namespace.
1477
1478
state->lru_list_elem_type = (PyTypeObject *)PyType_FromModuleAndSpec(
1479
module, &lru_list_elem_type_spec, NULL);
0 commit comments