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
SymPy: operator stubs incorrectly return only NotImplementedType #407
Several SymPy operator stubs declare NotImplementedType as their only return type. However, these methods return concrete values for supported operands.
The declarations are present on the current main branch:
Include the concrete return types. Retain NotImplementedType where the method can reject unsupported operands.
For example, DomainMatrix.__add__ needs a matrix return type, and PolyElement.__mul__ needs a polynomial return type.
This surfaced while testing a change to Pyrefly's handling of NotImplemented. A checker that interprets sentinel-only returns as definitive rejection can report unsupported-operation errors for these valid expressions.
Activity
Avasam commentedon Nov 1, 2026
I seriously recommend just deleting these stubs from your pylance installation and using sympy's inline types.