Skip to content

Commit 14e8e8a

Browse files
committed
fix(QueryList): More generic fixes (inner methods)
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 d94441e commit 14e8e8a

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
@@ -300,7 +300,7 @@ class QueryList(t.Generic[T], t.List[T]):
300300
def __init__(self, items: t.Optional["Iterable[T]"] = None) -> None:
301301
super().__init__(items if items is not None else [])
302302

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

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

0 commit comments

Comments
 (0)