Skip to content

Commit 2eec7ce

Browse files
committed
Return NotImplemented for unsupported comparisons
See https://docs.python.org/3.14/reference/datamodel.html#object.__eq__
1 parent 0a46b63 commit 2eec7ce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plotly/basedatatypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def __contains__(self, prop):
789789
def __eq__(self, other):
790790
if not isinstance(other, BaseFigure):
791791
# Require objects to both be BaseFigure instances
792-
return False
792+
return NotImplemented
793793
else:
794794
# Compare plotly_json representations
795795

@@ -5017,7 +5017,7 @@ def __eq__(self, other):
50175017
"""
50185018
if not isinstance(other, self.__class__):
50195019
# Require objects to be of the same plotly type
5020-
return False
5020+
return NotImplemented
50215021
else:
50225022
# Compare plotly_json representations
50235023

0 commit comments

Comments
 (0)