array.any() and array.all() always returning boolean values?
TL;DR: If nobody has concerns, I think we may give always returning boolean values for `any()` and `all()` a shot soon (for object input).
Today in the triage meeting, and generally once in a while it comes up that:
should always return booleans. Currently we have for example:
>>> np.array([None, "string"], dtype=object).any() 'string'
while we return booleans for anything that isn't an object dtype.
Note that our logical reductions, which are used as an implementation:
would still return the old result, so there would be a workaround available (although maybe hard to find).
One PR for this is:
And while I think that may need some tweaks, I think we may push something similar soon (with plenty of time to test before the release) if nobody voices concern.