Skip to content

Commit 2cdbd49

Browse files
committed
fix(QueryList): More generic fixes
src/libtmux/_internal/query_list.py:307: error: List comprehension has incompatible type List[tuple[Any, T]]; expected List[T] [misc] src/libtmux/_internal/query_list.py:376: error: Incompatible types in assignment (expression has type "Callable[[str | list[Any]], bool]", variable has type "Callable[[T], bool]") [assignment]
1 parent fcea365 commit 2cdbd49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libtmux/_internal/query_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class QueryList(t.Generic[T], t.List[T]):
301301
def __init__(self, items: t.Optional[Iterable[T]] = None) -> None:
302302
super().__init__(items if items is not None else [])
303303

304-
def items(self) -> t.List[T]:
304+
def items(self) -> t.List[t.Tuple[str, T]]:
305305
if self.pk_key is None:
306306
raise PKRequiredException()
307307
return [(getattr(item, self.pk_key), item) for item in self]
@@ -367,7 +367,7 @@ def filter_lookup(obj: t.Any) -> bool:
367367
_filter = matcher
368368
elif matcher is not None:
369369

370-
def val_match(obj: t.Union[str, t.List[t.Any]]) -> bool:
370+
def val_match(obj: t.Union[str, t.List[t.Any], T]) -> bool:
371371
if isinstance(matcher, list):
372372
return obj in matcher
373373
else:

0 commit comments

Comments
 (0)