You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Use __eq__ and .equals() to distinguish between elementwise and whole-object comparison #1395
I'd classify it as a bug since == shouldn't have been returning a scalar in the first place. According to PDEP-17, breaking changes caused by bugs don't need a warning.
it's true that we never documented dunders till recently. but we have so many assert tri1 == tr2 in the test suite that users would have reasonably relied upon to be the intended behavior. "another package does it differently" is only circumstantial whereas "this package has been doing it this way since the beginning" is direct.
we can do a quicker deprecation cycle, i.e. introduce equals in 0.11.0, change == in 1.0.0?
We could give it some time. A last concern for me though would be the kind of warning message we should issue in the meantime. How about we do something like:
Implement .equals() right away
Warn people that == will no longer be used for whole object comparison and to use .equals() instead.
@scks1 thanks for getting this going! now there's just the massive follow-up task of replacing all tri == other_tri in the codebase. interested in taking that on?
Activity
henrydingliu commentedon Sep 24, 2026
Is this {BUG] or [BRK]? can we do anything more than a deprecation warning?
genedan commentedon Sep 24, 2026
I'd classify it as a bug since
==shouldn't have been returning a scalar in the first place. According to PDEP-17, breaking changes caused by bugs don't need a warning.henrydingliu commentedon Sep 25, 2026
it's true that we never documented dunders till recently. but we have so many
assert tri1 == tr2in the test suite that users would have reasonably relied upon to be the intended behavior. "another package does it differently" is only circumstantial whereas "this package has been doing it this way since the beginning" is direct.we can do a quicker deprecation cycle, i.e. introduce
equalsin 0.11.0, change==in 1.0.0?genedan commentedon Sep 29, 2026
We could give it some time. A last concern for me though would be the kind of warning message we should issue in the meantime. How about we do something like:
.equals()right away==will no longer be used for whole object comparison and to use.equals()instead.Add Triangle.equals and warn on == between triangles
henrydingliu commentedon Nov 5, 2026
@scks1 thanks for getting this going! now there's just the massive follow-up task of replacing all
tri == other_triin the codebase. interested in taking that on?scks1 commentedon Nov 5, 2026
Yes, happy to. #1539 moves them to
equals: 187 comparisons in 13 test files and 15 in 7 docs notebooks. The library code itself has none.(This reply was made with Árbol, an AI assistant, under my direction.)
Use Triangle.equals in the io docstring examples
[TST] Use Triangle.equals in tests and docs (#1539)
henrydingliu commentedon Nov 10, 2026
all available work for 0.11 is done. moving milestone to 1.0 for element-wise ==