Skip to content

pathlib assumes that functools might not have lru_cache #98884

@sobolevn

Description

@sobolevn

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.

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions