Skip to content

pathlib assumes that functools might not have lru_cache #98884

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 Oct 30, 2022 · 1 comment
Closed

pathlib assumes that functools might not have lru_cache #98884

sobolevn opened this issue Oct 30, 2022 · 1 comment
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

There's this line in pathlib right now:

cpython/Lib/pathlib.py

Lines 218 to 219 in 018b248

if hasattr(functools, "lru_cache"):
_make_selector = functools.lru_cache()(_make_selector)

It was added 9 years ago as part of 31119e4

But, functools at this moment always has this function. It is widely used in other modules.

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Oct 30, 2022
@sobolevn sobolevn self-assigned this Oct 30, 2022
sobolevn added a commit to sobolevn/cpython that referenced this issue Oct 30, 2022
@AlexWaygood
Copy link
Member

Fixed in #98885. Thanks @sobolevn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants