-
-
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
Bugs in search -> findfirst deprecation and Compat #26145
Comments
The The second error corresponds to an invalid call: you're trying to look for a string inside a character, which doesn't make sense. Try swapping the arguments and using So AFAICT there's no bug here. |
I am aware that one should use The second error is my fault, but originates from the deprecation of |
I agree with tbole — I think this can be improved. Changing names is a great opportunity to provide non-breaking API changes. This deprecation could be: julia> search("x",'y')
┌ Warning: `search(s::AbstractString, c::Char)` is deprecated, use `i = findfirst(equalto(c), s); i === nothing ? 0 : i` instead.
│ caller = top-level scope
└ @ Core :0
0 Ok, that's a mouthful, but it jives with our practice of using deprecations to provide non-breaking functionality until the code is updated. |
Ah, good catch. See #26149. |
In 0.7
search
has been deprecated in favor offindfirst
/findlast
, however these behave differently thansearch
in some cases, e.g. if a value is not found.Another error occurs with 0.6 and Compat when using Compat.findfirst and passing Unicode strings.
The text was updated successfully, but these errors were encountered: