forked from sympy/sympy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve rich comparison with unknown types
Return NotImplemented when a rich comparison is unable to make sense of the input types. This way, the python interpreter is able to delegate to reflected methods as appropriate in order to maintain symmetric relations. This commit also removes direct invocations of rich comparison methods, like __eq__, except in super calls, explicitly reflected calls, and other cases where the order is essential (see, e.g., sympy#7951). These calls may sidestep the desired dispatching and introduce bugs by evaluating, e.g., not NotImplemented to False. Closes sympy#13078.
- Loading branch information
Showing
24 changed files
with
203 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.