-
Notifications
You must be signed in to change notification settings - Fork 109
Remove assert from __eq__ for windows #504
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
Comments
Can you summarize / explain the code snippet a bit more? I formatted the code
Yes. If you make a PR, I can examine it closer. |
Consider you iterate through all existing windows, to see if a window with a particular name already exists. However, in the The method to check equal for windows should be implemented like that: def __eq__(self, other: object) -> bool:
if not isinstance(other, Window):
return False
return self.window_id == other.window_id Is it clearer now? |
I may not be able to look at the PR / related code until this weekend
Yes What happens if you replace |
That should indeed work! However, I think we should still implement the |
Closed #505. |
The code above will crash, when the window exists and we then check the
if target_window == None
because of:I guess it would be better to remove the assert and return false. Should I do a PR?
The text was updated successfully, but these errors were encountered: