diff --git a/kitty/actions.py b/kitty/actions.py index b04f2648a..ab3f9acbd 100644 --- a/kitty/actions.py +++ b/kitty/actions.py @@ -2,7 +2,7 @@ # License: GPLv3 Copyright: 2021, Kovid Goyal import inspect -from typing import NamedTuple, cast +from typing import NamedTuple from .boss import Boss from .tabs import Tab @@ -50,7 +50,7 @@ def get_all_actions() -> dict[ActionGroup, list[Action]]: short_help = first long_help = '\n'.join(lines).strip() assert spec.group in groups - return Action(getattr(x, '__name__'), cast(ActionGroup, spec.group), short_help, long_help) + return Action(getattr(x, '__name__'), spec.group, short_help, long_help) seen = set() for cls in (Window, Tab, Boss): diff --git a/kitty/search_query_parser.py b/kitty/search_query_parser.py index 4c551d11b..51a6f7cc7 100644 --- a/kitty/search_query_parser.py +++ b/kitty/search_query_parser.py @@ -93,7 +93,8 @@ class NotNode(SearchTreeNode): self.rhs = rhs def __call__(self, candidates: set[T], get_matches: GetMatches[T]) -> set[T]: - return candidates.difference(self.rhs(candidates, get_matches)) + rhs_result: set[T] = self.rhs(candidates, get_matches) + return candidates.difference(rhs_result) def iter_token_nodes(self) -> Iterator['TokenNode']: yield from self.rhs.iter_token_nodes()