-
-
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
Make indexin first argument accept any iterable #23845
Conversation
Actually, with this change, the first argument to julia> indexin(4, [3,4,5])
0-dimensional Array{Int64,0}:
2 but notice that it returns it in the form of a zero-dimensional array. Should this call return an |
Yes, 100%. |
804dc88
to
372d179
Compare
OK, I split this into two commits: the first updates the docstring and tests according to the old functionality, while the second adds new functionality. I'm actually unsure the best way to implement the goal of having a scalar return a scalar instead of a 0D array. My current approach has one broken test (marked by |
372d179
to
e48d23d
Compare
I fixed the 0-dimensional array issue by changing from a comprehension to calling One remaining issue is that |
I'm pretty happy with how this stands -- I don't think the |
I also fixed the docstring and added a test where a matrix is passed.
Also compactified the tests according to https://github.com/JuliaLang/julia/pull/8622/files#r18615289 :-)