Skip to content

Commit

Permalink
Fix some pyright complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jul 27, 2021
1 parent cd8f01c commit 8115515
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions emrichen/input/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, List, Union
from typing import TYPE_CHECKING, Any, List, Union

from ..exceptions import NoSuchTag
from ..tags.base import tag_registry
Expand All @@ -7,7 +7,7 @@
from ..tags.compose import Compose


def make_compose(names: Union[str, List[str]], value: Union[str, dict]) -> 'Compose':
def make_compose(names: Union[str, List[str]], value: Any) -> 'Compose':
if isinstance(names, str):
names = [name.strip() for name in names.split(',')]
for name in names:
Expand Down
3 changes: 2 additions & 1 deletion emrichen/tags/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ def enrich(self, context: Context) -> str:
items = context.enrich(self.data)
if not isinstance(items, list):
raise TypeError(f'{self}: must resolve to a list')

if not isinstance(separator, str):
raise TypeError(f'{self}: separator {separator!r} is not a string')
return separator.join(str(i) for i in items)
2 changes: 2 additions & 0 deletions emrichen/tags/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def enrich(self, context: Context):
a = context.enrich(self.data[0])
op_name = context.enrich(self.data[1])
b = context.enrich(self.data[2])
else:
raise TypeError(f"{self.data!r} can't be interpreted as a binary operation")

op = operators[op_name]

Expand Down
2 changes: 1 addition & 1 deletion emrichen/tags/with_.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class With(BaseTag):

value_types = (dict,)

def enrich(self, context: Context) -> int:
def enrich(self, context: Context):
vars_ = self.data['vars']
template = self.data['template']

Expand Down

0 comments on commit 8115515

Please sign in to comment.