Skip to content

Commit b724d9d

Browse files
committed
Fix pytype errors
1 parent 4324985 commit b724d9d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

mkdocstrings/handlers/crystal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_handler(
1515
theme: str,
1616
custom_templates: Optional[str] = None,
1717
crystal_docs_flags: Sequence[str] = (),
18-
source_locations: Mapping[str, str] = (),
18+
source_locations: Mapping[str, str] = {},
1919
**config: Any
2020
) -> CrystalHandler:
2121
collector = CrystalCollector(

mkdocstrings/handlers/crystal/collector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
import shlex
88
import subprocess
9-
from typing import Any, Callable, Iterable, Iterator, List, Mapping, Sequence, TypeVar, Union
9+
from typing import Any, Callable, Iterable, Iterator, List, Mapping, Sequence, TypeVar, Union, cast
1010

1111
import mkdocs.exceptions
1212
import mkdocs.utils
@@ -29,7 +29,7 @@
2929

3030
class CrystalCollector(BaseCollector):
3131
def __init__(
32-
self, crystal_docs_flags: Sequence[str] = (), source_locations: Mapping[str, str] = ()
32+
self, crystal_docs_flags: Sequence[str] = (), source_locations: Mapping[str, str] = {}
3333
):
3434
"""Create a "collector", reading docs from `crystal doc` in the current directory.
3535
@@ -190,7 +190,7 @@ def __getattr__(self, name: str):
190190
return val
191191

192192
def walk_types(self) -> Iterator[DocType]:
193-
types = self.types # type: DocMapping[DocType]
193+
types = cast(DocMapping[DocType], self.types)
194194
for typ in types:
195195
yield typ
196196
yield from typ.walk_types()

0 commit comments

Comments
 (0)