-
-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Description
julia> using RecursiveArrayTools
julia> a = ArrayPartition([NaN])
([NaN],)
julia> any(isnan,a)
false
julia> any(isnan,a[:]) #dispatches on Base.any instead
true
The responsible commit is years old, but I cannot see how this could be intended.
The current implementation applies the function twice, and would probably return false in many cases, where f does not ask about booleans:
Base.any(f::Function,A::ArrayPartition) = any(f,(any(f,x) for x in A.x))
Perhaps, this is what it was supposed to be:
Base.any(f::Function,A::ArrayPartition) = any((any(f,x) for x in A.x))
In this case however, we might as well dispatch to the generic Base.any function, so maybe I am missing something.
Metadata
Metadata
Assignees
Labels
No labels