-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Allow collect
to return non-Array
types
#58513
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
base: master
Are you sure you want to change the base?
Conversation
As discussed at #36448. This is already what some packages such as StaticArrays and CategoricalArrays do. Without this, `collect` is redundant with `Array(itr)` or `Array{T}(itr)`.
at the very least it should specify |
I object to this. It makes collect more confusing and harder to reason about. Edit: Although triage disagrees with me... So maybe the docstring should follow triage: #50051 (comment) |
Cross-posting from the linked issue:
|
@jakobnissen Yes, the idea is that if that operation is supposed to return an array, writing
@adienes It's true that it's not super precise, but this is how the docstring for |
As discussed at #36448 and triaged at #50051 (comment). This is already what some packages such as OffsetArrays, StaticArrays and CategoricalArrays do.
See also #16029, #36448.