Fix typing issues pointed out by updated mypy

This commit is contained in:
Kovid Goyal
2020-10-12 23:03:07 +05:30
parent 91a714947c
commit efca2658ea
5 changed files with 20 additions and 13 deletions

View File

@@ -68,7 +68,10 @@ class Collection:
self.removed_count += len(lines_for_path(left_path))
def finalize(self) -> None:
self.all_paths.sort(key=path_name_map.get)
def key(x: str) -> str:
return path_name_map.get(x, '')
self.all_paths.sort(key=key)
def __iter__(self) -> Iterator[Tuple[str, str, Optional[str]]]:
for path in self.all_paths: