Skip to content

_functools.KeyWrapper is exposed after convertion to a new module type #96641

Description

@sobolevn

After #23405 we now have KeyWrapper exposed.
I suspect that it is an internal helper and should not be importable:

Python3.12.0a0 (heads/main:0d04b8d9e1, Sep72022, 13:20:36) [Clang11.0.0 (clang-1100.0.33.16)] ondarwinType"help", "copyright", "credits"or"license"formoreinformation.
>>>from_functoolsimportKeyWrapper>>>help(KeyWrapper)
HelponclassKeyWrapperinmodulefunctools:
classKeyWrapper(builtins.object)
|Methodsdefinedhere:
||__call__(self, /, *args, **kwargs)
|Callselfasafunction.
||__eq__(self, value, /)
|Returnself==value.
||__ge__(self, value, /)
|Returnself>=value.
||__getattribute__(self, name, /)
|Returngetattr(self, name).
||__gt__(self, value, /)
|Returnself>value.
||__le__(self, value, /)
|Returnself<=value.
||__lt__(self, value, /)
|Returnself<value.

Related #26416
Found while working on #96640
CC @shihai1991

I will send a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions