Closed m1guelperez closed 1 year ago
Actually, I would try to avoid negations with not
and express the code like this:
def __eq__(self, other: object) -> bool:
if isinstance(other, Window):
return self.window_id == other.window_id
return False
Just my two cents.
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
4d51e53
) 88.84% compared to head (bdb105f
) 88.79%.
Files | Patch % | Lines |
---|---|---|
src/libtmux/window.py | 33.33% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@m1guelperez Rebased
@JThoennes That makes sense, I will make that change.
@m1guelperez Can you sign the CLA?
@m1guelperez Can you sign the CLA?
Done :)
@m1guelperez Merged
Thank you both!
This code failed before at
if target_window == None
because comparison for windows was implemented like that:However, the assert seems a bit off since it is a way to strong assumption. Thus I changed it to:
This code now properly returns
False
when we compare a window with==
and the condition is indeedFalse
.