[Python-checkins] bpo-44256: Do not expose _functools._list_elem_type (GH-26416)

methane webhook-mailer at python.org
Fri May 28 03:10:52 EDT 2021


https://github.com/python/cpython/commit/35be1f3602c8c66199d8c0a2f2805115864235fb
commit: 35be1f3602c8c66199d8c0a2f2805115864235fb
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: methane <songofacandy at gmail.com>
date: 2021-05-28T16:10:45+09:00
summary:

bpo-44256: Do not expose _functools._list_elem_type (GH-26416)

It is internal use only type.
(cherry picked from commit 28be3191a9db2769ed05e55c6bcbccdd029656dd)

Co-authored-by: Inada Naoki <songofacandy at gmail.com>

files:
M Modules/_functoolsmodule.c

diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 19cfa9b07b340..1cfb08caef54d 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;
 }



More information about the Python-checkins mailing list