Skip to content

Fixed __eq__ for windows. #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux

<!-- Maintainers and contributors: Insert change notes for the next release above -->

### Improvement

- `Window.__eq__` now returns `False` instead of raising `AssertionError`, thank
you @m1guelperez! (#505)

## libtmux 0.24.1 (2023-11-23)

### Packaging
Expand Down
5 changes: 3 additions & 2 deletions src/libtmux/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,9 @@ def attached_pane(self) -> t.Optional["Pane"]:
# Dunder
#
def __eq__(self, other: object) -> bool:
assert isinstance(other, Window)
return self.window_id == other.window_id
if isinstance(other, Window):
return self.window_id == other.window_id
return False

def __repr__(self) -> str:
return "{}({} {}:{}, {})".format(
Expand Down