-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
findall(::Fix2{typeof(in)}, array)
and _findin
make assumptions on finiteness
#29124
Comments
Before #24673, this method was called by If we restrict the signature, calls will fall back to the most generic |
Since a |
I don't think that |
To be clear, this issue is about the |
Hmm... Is there not a fallback definition for |
It falls back to |
That seems... presumptuous. |
We've been over this. But actually, I think all we can do here is limit that method to some types like AbstractArray, and other uses might have to explicitly write |
Even for tuples and small If all the user needs to write is |
When creating the predicate
pred = in(something)
, it may be thatsomething
is not a finite, iterable collection, but thatin(x, something)
is still a fast operation. (In my case it's 3D pointsin
aSphere
- fast to determine, butSphere
is an uncountable set).In this case, the implementation of
_findin(a, b)
is not valid, because we assumeb
can be converted to aSet
here.This function is called by
findall
here, without consideration whethersomething
(i.e.pred.x
) is finite.I would recommend changing this signature to the case where
pred.x isa Union{AbstractArray, Tuple}
for consistency, but I'm not sure if that will cause regressions for anyone?The text was updated successfully, but these errors were encountered: