From: Jelle Zijlstra Date: Sun, 11 Apr 2021 14:49:42 +0000 (-0700) Subject: fix typing issue around lru_cache arguments (#2098) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/2116eca51f1108ebc924185c87bc363d8e0329b3?hp=e4003c2c439fc08a407d3024a195c010f03c4173 fix typing issue around lru_cache arguments (#2098) This was found by python/mypy#10308 --- diff --git a/src/black/__init__.py b/src/black/__init__.py index 0065bea..2bb42a4 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -302,7 +302,7 @@ def supports_feature(target_versions: Set[TargetVersion], feature: Feature) -> b return all(feature in VERSION_TO_FEATURES[version] for version in target_versions) -def find_pyproject_toml(path_search_start: Iterable[str]) -> Optional[str]: +def find_pyproject_toml(path_search_start: Tuple[str, ...]) -> Optional[str]: """Find the absolute filepath to a pyproject.toml if it exists""" path_project_root = find_project_root(path_search_start) path_pyproject_toml = path_project_root / "pyproject.toml" @@ -6214,7 +6214,7 @@ def gen_python_files( @lru_cache() -def find_project_root(srcs: Iterable[str]) -> Path: +def find_project_root(srcs: Tuple[str, ...]) -> Path: """Return a directory containing .git, .hg, or pyproject.toml. That directory will be a common parent of all files and directories