-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Duck type the function in map, reduce, etc. #10314
Conversation
filter!(r::Regex, v) = filter!(x->ismatch(r,x), v) | ||
filter(r::Regex, v) = filter(x->ismatch(r,x), v) | ||
|
||
filter!(r::Regex, d::Dict) = filter!((k,v)->ismatch(r,k),d) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this would need a deprecation, since filter on Dicts expects a 2-argument function. Or I guess we could add a call
overload for Regex
with 2 extra arguments, but that seems too magical since it really only makes sense for this use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
We're green. OK to merge? |
This is motivated by the existence of call-overloading
af864f4
to
6cb7d5b
Compare
Duck type the function in map, reduce, etc.
Oh crap. I'll try to straighten this out. Thanks for catching it. |
OK, it looks like it was simply that one file (git managed the conflict by keeping the file). Fixed in 74c71fb. |
@timholy Did you have any changes to DArray that might be relevant in https://github.com/JuliaParallel/DistributedArrays.jl? |
Replacement of #10312 without all the
c
s. Seems that if you force-push before reopening the issue, GitHub gets unhappy.