fix mypy errors in search_query_parser.py and actions.py

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/5d37ece0-388b-4c99-a1bc-3b2c3bed34e6

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-31 17:57:12 +00:00
committed by GitHub
parent 50ac569aad
commit 6c354159a8
2 changed files with 4 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
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):

View File

@@ -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()