> What you are hoping for here is known as "short circuit" or "lazy" evaluation.
In SciPy, we have the private utility function `_lazywhere`[1] for this.
Cheers,
Lucas
[1]
https://github.com/scipy/scipy/blob/f44326023dc51758495491fc9f06858fd38358a0/scipy/_lib/_util.py#L88-L156
> On 26 Apr 2024
What you are hoping for here is known as "short circuit" or "lazy"
evaluation. Namely, this would work if np.where(cond, x, y) only evaluates
x if cond is true and only evaluates y if cond is false. In this case, not
only can it handle situations where one of the true/false cases "breaks"
one of th