-
-
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
Check size of arrays being assigned #911
Comments
cc: @alanedelman |
Could be considered a bug, or could just be defined to take the necessary number of elements from an iterable. The right side could even be an infinite vector. |
What happens in multi-dimensional arrays if there is a size mismatch? -viral On 04-Jun-2012, at 7:14 AM, Jeff Bezanson wrote:
|
I really think this should be an error. |
If taking a few elements from a bigger structure is intended, it's worth slicing on the right too. |
In the middle of fixing this. I encountered the following use case in the tests:
If the RHS is 1d, should we just check the element count? |
The rule I propose is: the number of elements on the left and right must match. Then, either the left/right shapes match in the normal way (i.e. ignoring trailing singleton dims), or one side can be 1d. This allows filling an n-D region from a vector.
I like this solution. Could this be closed? |
This seems like some sort of bug
indexing five elements on the left, six on the right
The text was updated successfully, but these errors were encountered: