8000 gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642) · python/cpython@eecbb54 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eecbb54

Browse files
gh-96641: Do not expose KeyWrapper in _functoolsmodule.c (gh-96642)
(cherry picked from commit 2fd7246) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent b6af933 commit eecbb54

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Do not expose ``KeyWrapper`` in :mod:`_functools`.

Modules/_functoolsmodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,9 +1470,8 @@ _functools_exec(PyObject *module)
14701470
if (state->keyobject_type == NULL) {
14711471
return -1;
14721472
}
1473-
if (PyModule_AddType(module, state->keyobject_type) < 0) {
1474-
return -1;
1475-
}
1473+
// keyobject_type is used only internally.
1474+
// So we don't expose it in module namespace.
14761475

14771476
state->lru_list_elem_type = (PyTypeObject *)PyType_FromModuleAndSpec(
14781477
module, &lru_list_elem_type_spec, NULL);

0 commit comments

Comments
 (0)
0