-
Notifications
You must be signed in to change notification settings - Fork 110
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
Conversation
|
Actually, I would try to avoid negations with def __eq__(self, other: object) -> bool:
if isinstance(other, Window):
return self.window_id == other.window_id
return FalseJust my two cents. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #505 +/- ##
==========================================
- Coverage 88.84% 88.79% -0.06%
==========================================
Files 35 35
Lines 3514 3515 +1
Branches 484 485 +1
==========================================
- Hits 3122 3121 -1
- Misses 284 285 +1
- Partials 108 109 +1 ☔ View full report in Codecov by Sentry. |
|
@m1guelperez Rebased @JThoennes That makes sense, I will make that change. |
|
@m1guelperez Can you sign the CLA? |
Done :) |
|
@m1guelperez Merged Thank you both! |
|
This is live in v0.25.0 |
This code failed before at
if target_window == Nonebecause 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
Falsewhen we compare a window with==and the condition is indeedFalse.