-
-
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
map with different length iterators #13361
Comments
(there are a some similar cases where such auto-expansion might be convenient -- but possibly undesirable globally -- such as indexing a KeyIterator: |
|
Maybe this should be allowed for 1-d arrays of different lengths? |
@JeffBezanson Is it logically correct if map(f, x, y) work with different lengths of x and y and if length(x) < length(y) the resulting array size should be length(x)? |
I also think that issue #29523 is related to this problem. |
An orthogonal solution is to define new iterators like |
The |
No, julia> promote_shape((3, 5), (2, 6))
ERROR: DimensionMismatch("dimensions must match")
Stacktrace:
[1] promote_shape(::Tuple{Int64,Int64}, ::Tuple{Int64,Int64}) at ./indices.jl:103
[2] top-level scope at none:0 |
IIUC this should be fixed by #29927:
|
Yes, the reported issue was fixed by that:
|
Is it reasonable that
map
can deal with infinite length iterators well but fails to work with two different finite length iterators?works well
error occurs
The text was updated successfully, but these errors were encountered: