Skip to content

Commit

Permalink
Replace lru_cache with functools.cache (#18337)
Browse files Browse the repository at this point in the history
Python 3.9 added `functools.cache` which can replace
`lru_cache(maxsize=None)`.
https://docs.python.org/3/library/functools.html#functools.cache
  • Loading branch information
cdce8p authored Dec 25, 2024
1 parent 624e179 commit aa0b6f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/modulefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def default_lib_path(
return path


@functools.lru_cache(maxsize=None)
@functools.cache
def get_search_dirs(python_executable: str | None) -> tuple[list[str], list[str]]:
"""Find package directories for given python. Guaranteed to return absolute paths.
Expand Down

0 comments on commit aa0b6f0

Please sign in to comment.