Skip to content

RationalFunction.__eq__: return NotImplemented for non-RationalFunction - #250

Open
Chessing234 wants to merge 1 commit into
teorth:mainfrom
Chessing234:codex/clean-pr-244
Open

Chessing234 wants to merge 1 commit into
teorth:mainfrom
Chessing234:codex/clean-pr-244

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

RationalFunction.__eq__ and Constraint.__eq__ access type-specific attributes on unrelated operands, raising AttributeError for comparisons such as RationalFunction([1]) == 3. Return NotImplemented for unrelated types, matching the existing polynomial comparison convention and allowing Python to handle reflected comparison.

Adds the equality regression to the full test runner. Validation: the regression and complete tests/test_all.py pass with the project dependencies installed, including pycddlib 2.1.8.post1; git diff --check passes.

Replaces #244 with a clean commit history.

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.

1 participant