Skip to content

Remove Symbol.equals() and Symbol.maybe_equals() methods - #615

Open
arcondello wants to merge 1 commit into
dwavesystems:mainfrom
arcondello:breaking-change/remove-maybe_equals-and-equals
Open

Remove Symbol.equals() and Symbol.maybe_equals() methods#615
arcondello wants to merge 1 commit into
dwavesystems:mainfrom
arcondello:breaking-change/remove-maybe_equals-and-equals

Conversation

@arcondello

Copy link
Copy Markdown
Member

This is a backwards compatibility break

Description

These functions had several issues

  • Confusing name/purpose. They were meant to allow comparison between symbols across different models (e.g., for testing serialization) but the name is confusing and they incidentally worked within models.
  • We didn't correctly implement them. Most symbols didn't have the overloads they were meant to.

We might want to add some new methods in the future for this purpose, but for now IMO we should just drop these.

AI Generation Disclosure

No AI used.

@arcondello arcondello added the enhancement New feature or request label Aug 13, 2026

# All nodes in the model need to match, and to have the same states
for ls, rs in zip(lhs.iter_symbols(), rhs.iter_symbols()):
self.assertTrue(ls.maybe_equals(rs))

@arcondello arcondello Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should do type(ls) is type(rs) here at least

@fastbodin fastbodin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Baring above small change, LGMT

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants