Skip to content

Commit

Permalink
lint: flake prefers is on type comparison instead of ==
Browse files Browse the repository at this point in the history
I think if a type chooses to overload __eq__ it should do so.
  • Loading branch information
maartenbreddels committed Oct 3, 2023
1 parent f52bef9 commit 8e0db3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reacton/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def equals(a, b):

if a is b:
return True
if type(a) != type(b): # is this always true? after a == b failed?
# ignore E721 for now
if type(a) != type(b): # noqa: E721 # is this always true? after a == b failed?
return False
if isinstance(a, Element):
return same_component(a.component, b.component) and equals(a.args, b.args) and equals(a.kwargs, b.kwargs)
Expand Down

0 comments on commit 8e0db3e

Please sign in to comment.