File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -344,5 +344,12 @@ def reset(self) -> "Pane":
344344 self .cmd ("send-keys" , r"-R \; clear-history" )
345345 return self
346346
347+ #
348+ # Dunder
349+ #
350+ def __eq__ (self , other : object ) -> bool :
351+ assert isinstance (other , Pane )
352+ return self .pane_id == other .pane_id
353+
347354 def __repr__ (self ) -> str :
348355 return "{}({} {})" .format (self .__class__ .__name__ , self .pane_id , self .window )
Original file line number Diff line number Diff line change @@ -551,5 +551,12 @@ def list_windows(self) -> t.List["Window"]:
551551 #: Was used by TmuxRelationalObject (but that's longer used in this class)
552552 children = windows
553553
554+ #
555+ # Dunder
556+ #
557+ def __eq__ (self , other : object ) -> bool :
558+ assert isinstance (other , Session )
559+ return self .session_id == other .session_id
560+
554561 def __repr__ (self ) -> str :
555562 return f"{ self .__class__ .__name__ } ({ self .session_id } { self .session_name } )"
Original file line number Diff line number Diff line change @@ -550,6 +550,13 @@ def list_panes(self) -> t.List["Pane"]:
550550 #: TmuxRelationalOjbect anymore
551551 children = panes
552552
553+ #
554+ # Dunder
555+ #
556+ def __eq__ (self , other : object ) -> bool :
557+ assert isinstance (other , Window )
558+ return self .window_id == other .window_id
559+
553560 def __repr__ (self ) -> str :
554561 return "{}({} {}:{}, {})" .format (
555562 self .__class__ .__name__ ,
You can’t perform that action at this time.
0 commit comments