Skip to content

Return NotImplemented for unsupported comparisons#5547

Open
RazerM wants to merge 3 commits intoplotly:mainfrom
RazerM:feature/eq-return-not-implemented
Open

Return NotImplemented for unsupported comparisons#5547
RazerM wants to merge 3 commits intoplotly:mainfrom
RazerM:feature/eq-return-not-implemented

Conversation

@RazerM
Copy link
Copy Markdown

@RazerM RazerM commented Mar 27, 2026

Link to issue

Closes #5546

Description of change

Updated the __eq__ implementations to return NotImplemented instead of False when comparing against an unsupported type. This aligns with Python's data model and allows the other operand to handle the comparison.

Demo

N/A

Testing strategy

Additional information (optional)

https://docs.python.org/3.14/reference/datamodel.html#object.__eq__

Guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Figure.__eq__ returns False for unsupported comparisons

1 participant