@@ -388,9 +388,7 @@ class TmuxRelationalObject(Generic[O, D]):
388
388
children : t .List [O ]
389
389
child_id_attribute : str
390
390
391
- def find_where (
392
- self , attrs : Dict [str , str ]
393
- ) -> Optional [Union ["Pane" , "Window" , "Session" ]]:
391
+ def find_where (self , attrs : D ) -> Optional [Union ["Pane" , "Window" , "Session" ]]:
394
392
"""Return object on first match.
395
393
396
394
.. versionchanged:: 0.4
@@ -403,19 +401,18 @@ def find_where(
403
401
return None
404
402
405
403
@overload
406
- def where (self , attrs : Dict [ str , str ] , first : "Literal[True]" ) -> O :
404
+ def where (self , attrs : D , first : "Literal[True]" ) -> O :
407
405
...
408
406
409
407
@overload
410
- def where (self , attrs : Dict [ str , str ] , first : "Literal[False]" ) -> t .List [O ]:
408
+ def where (self , attrs : D , first : "Literal[False]" ) -> t .List [O ]:
411
409
...
412
410
413
411
@overload
414
- def where (self , attrs : Dict [ str , str ] ) -> t .List [O ]:
412
+ def where (self , attrs : D ) -> t .List [O ]:
415
413
...
416
414
417
- def where (self , attrs : Dict [str , str ], first : bool = False ) -> t .Union [List [O ], O ]:
418
- # ) -> List[Union["Session", "Pane", "Window", t.Any]]:
415
+ def where (self , attrs : D , first : bool = False ) -> t .Union [List [O ], O ]:
419
416
"""
420
417
Return objects matching child objects properties.
421
418
@@ -426,7 +423,7 @@ def where(self, attrs: Dict[str, str], first: bool = False) -> t.Union[List[O],
426
423
427
424
Returns
428
425
-------
429
- list
426
+ list of objects, or one object if ``first=True``
430
427
"""
431
428
432
429
# from https://github.com/serkanyersen/underscore.py
@@ -445,7 +442,7 @@ def by(val: O) -> bool:
445
442
return target_children [0 ]
446
443
return target_children
447
444
448
- def get_by_id (self , id : str ) -> Optional [Union [ "Pane" , "Window" , "Session" ] ]:
445
+ def get_by_id (self , id : str ) -> Optional [O ]:
449
446
"""
450
447
Return object based on ``child_id_attribute``.
451
448
0 commit comments