-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugsomething brokensomething broken
Description
Description
Python's rich comparison methods should return NotImplemented so that the RHS of a comparison is given the opportunity to implement the comparison.
In my case, I have a test snapshot fixture such that I can do assert figure == snapshot.
Screenshots/Video
N/A
Steps to reproduce
import plotly.graph_objects as go
class MyObject:
def __eq__(self, other):
print(f"MyObject.__eq__({other!r}) called")
return NotImplemented
print(1 == MyObject())
print(go.Figure() == MyObject())MyObject.__eq__(1) called
False
False
There should be a print of MyObject.__eq__(Figure({...})) called.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugsomething brokensomething broken