Skip to content

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

Closed
Chessing234 wants to merge 1 commit into
teorth:mainfrom
Chessing234:fix-rationalfunction-eq-notimplemented
Closed

Chessing234 wants to merge 1 commit into
teorth:mainfrom
Chessing234:fix-rationalfunction-eq-notimplemented

Conversation

@Chessing234

@Chessing234 Chessing234 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • RationalFunction.__eq__ now returns NotImplemented when other is not a RationalFunction, matching Polynomial.__eq__.
  • Constraint.__eq__ gets the same guard for non-Constraint operands.
  • Adds test_rationalfunction_eq_regression.py asserting R([1]) == 3 is False without raising AttributeError; wired into test_all.py.

Test plan

  • cd blueprint/src/python && python tests/test_rationalfunction_eq_regression.py (with project deps installed)
  • python tests/test_all.py

closing to replace this proposal with a clean commit history.

Avoid AttributeError when comparing to unrelated types; add a small regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
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