Leaklens

astropy__astropy-13977

Should `Quantity.__array_ufunc__()` return `NotImplemented` instead of raising `ValueError` if the inputs are incompatible?

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

So, basically it could be as simple as something equivalent to `if not all(isinstance(io, (Quantity, ndarray, Column) for io in *(inputs+out)): return NotImplemented` -- though done in a way that does not slow down the common case where inputs are OK -- say with a `try/except`.

A third check settled an earlier disagreement. The text states the fix: “So, basically it could be as simple as something equivalent to `if not all(isinstance(io, (Quantity, ndarray, Column) for io in *(inputs+out)): return NotImple…”

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