Leaklens

sympy__sympy-13091

Return NotImplemented, not False, upon rich comparison with unknown type

Verdict: the fix is stated in the issue (Tier A).

Subclassing won't help in this case, it will just move the problem to line 319 (returns ``False`` if sympy types are different). Which is to say, ``NotImplemented`` should be returned in this case too in order to maintain symmetric relations.

The text states the fix: “For this particular example, the line to edit is line 316 in basic.py (https://github.com/sympy/sympy/blob/master/sympy/core/basic.py#L316) -- just replace ``return Fals…”

All SWE-bench Verified tasks · more sympy/sympy tasks · How the check works