Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sobolevn opened this issue Sep 7, 2022 · 1 comment
Closed
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Sep 7, 2022

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

Python 3.12.0a0 (heads/main:0d04b8d9e1, Sep  7 2022, 13:20:36) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from _functools import KeyWrapper
>>> help(KeyWrapper)
Help on class KeyWrapper in module functools:

class KeyWrapper(builtins.object)
 |  Methods defined here:
 |
 |  __call__(self, /, *args, **kwargs)
 |      Call self as a function.
 |
 |  __eq__(self, value, /)
 |      Return self==value.
 |
 |  __ge__(self, value, /)
 |      Return self>=value.
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __gt__(self, value, /)
 |      Return self>value.
 |
 |  __le__(self, value, /)
 |      Return self<=value.
 |
 |  __lt__(self, value, /)
 |      Return self<value.

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

I will send a PR shortly.

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Sep 7, 2022
sobolevn added a commit to sobolevn/cpython that referenced this issue Sep 7, 2022
sobolevn added a commit to sobolevn/cpython that referenced this issue Sep 7, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 7, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 7, 2022
miss-islington added a commit that referenced this issue Sep 7, 2022
(cherry picked from commit 2fd7246)

Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington added a commit that referenced this issue Sep 7, 2022
(cherry picked from commit 2fd7246)

Co-authored-by: Nikita Sobolev <[email protected]>
@corona10
Copy link
Member

corona10 commented Sep 7, 2022

I double-checked with the old python version


Python 3.8.13 (default, Sep  7 2022, 20:07:00)
[Clang 13.1.6 (clang-1316.0.21.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _functools
>>> dir(_functools)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', '_lru_cache_wrapper', 'cmp_to_key', 'partial', 'reduce']
>>>

Now we can close the issue

@corona10 corona10 closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants