Skip to content

Commit

Permalink
Tweaks following mypy 1.7 update.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Nov 10, 2023
1 parent ef5f80b commit f52cab5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/reader/_parser/feedparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __call__(
resource,
resolve_relative_uris=True,
sanitize_html=True,
response_headers=headers,
response_headers=headers or {}, # type: ignore[arg-type]
)
return _process_feed(url, result)

Expand Down
2 changes: 1 addition & 1 deletion src/reader/_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def chunk_size(self) -> int:
def strip_html(text: SQLiteType) -> SQLiteType:
# strip_html is not part of the Search interface,
# but is part of the private API of this implementation.
return strip_html(text)
return strip_html(text) # type: ignore[no-any-return]

@wrap_exceptions(SearchError)
def check_update_dependencies(self) -> None:
Expand Down
4 changes: 3 additions & 1 deletion src/reader/_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ def inner(
self.get_db(), query, context, chunk_size, last, make_feed_for_update
)

yield from join_paginated_iter(inner, self.chunk_size)
# ignore needed may be due to possible regression in mypy 1.7
# https://github.com/python/mypy/issues/16451
yield from join_paginated_iter(inner, self.chunk_size) # type: ignore[arg-type]

def _get_entries_for_update(
self, entries: Iterable[tuple[str, str]]
Expand Down
2 changes: 1 addition & 1 deletion src/reader/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _namedtuple_compat:
# TODO: can we get rid of _namedtuple_compat?

def _replace(self, **kargs: Any) -> Self:
return dataclasses.replace(self, **kargs) # type: ignore[type-var,misc]
return dataclasses.replace(self, **kargs) # type: ignore[type-var]

def _asdict(self) -> dict[str, Any]:
return dict(self.__dict__)
Expand Down

0 comments on commit f52cab5

Please sign in to comment.