From: Inada Naoki Date: Fri, 28 May 2021 05:09:32 +0000 (+0900) Subject: bpo-44256: Do not expose _functools._list_elem_type (GH-26416) X-Git-Tag: v3.11.0a1~1005 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28be3191a9db2769ed05e55c6bcbccdd029656dd;p=thirdparty%2FPython%2Fcpython.git bpo-44256: Do not expose _functools._list_elem_type (GH-26416) It is internal use only type. --- diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 19cfa9b07b34..1cfb08caef54 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1460,9 +1460,8 @@ _functools_exec(PyObject *module) if (state->lru_list_elem_type == NULL) { return -1; } - if (PyModule_AddType(module, state->lru_list_elem_type) < 0) { - return -1; - } + // lru_list_elem is used only in _lru_cache_wrapper. + // So we don't expose it in module namespace. return 0; }