Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Sep 27, 2023
1 parent ee1ae89 commit 4fd851a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions papyri/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from dataclasses import dataclass
from functools import lru_cache
from pathlib import Path
from typing import Optional, Set, Any, Dict, List, Callable, Tuple
from typing import Optional, Set, Any, Dict, List, Callable, Tuple, Iterable

from flatlatex import converter
from jinja2 import Environment, FileSystemLoader, StrictUndefined, select_autoescape
Expand Down Expand Up @@ -100,15 +100,15 @@ def until_ruler(doc: str) -> str:

def compute_siblings_II(
ref: str, family: Set[RefInfo]
) -> Dict[str, List[Tuple[str, str]]]:
) -> Dict[str, List[Tuple[RefInfo, str]]]:
""" """
assert isinstance(ref, str)

module_versions = defaultdict(lambda: set())
for f in family:
module_versions[f.module].add(f.version)

module_versions_max = {k: max(v) for k, v in module_versions.items()}
module_versions_max = {k: max(v) for k, v in module_versions.items()} # type: ignore [type-var]

family = {f for f in family if f.version == module_versions_max[f.module]}

Expand All @@ -133,9 +133,9 @@ def compute_siblings_II(
return siblings


def make_tree(names: List[str]):
rd = lambda: defaultdict(rd)
tree = defaultdict(rd)
def make_tree(names: Iterable[str]):
rd = lambda: defaultdict(rd) # type: ignore
tree = defaultdict(rd) # type: ignore

for n in names:
parts = n.split(".")
Expand Down

0 comments on commit 4fd851a

Please sign in to comment.