Open
Description
As far as I can tell, there is currently no idiomatic way of collecting an arbitrary iterable into a Vector{T}
. To me this seems like a basic operation. At least, I need it quite often.
collect
does not always return aVector
- Array comprehensions calls
collect
on aGenerator
, which preserves shape information in some cases. Hence, it does not always returnVector
vec(collect(itr))
returns an array with shared memory. I believe this can be problematic sometimes, but I'm not completely sure.[i for i in itr if true]
does work, but is not exactly idiomatic. Also, I don't think it's documented to return aVector
.