-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Incorrect Exception when indexing array with field. #8519
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
Comments
It looks like stray voltage from the indexing work. OTOH
So one could argue that both errors should be
So strictly speaking, it seems that the first case should be |
The I actually didn't realize the Just to link up some PRs, here are some PRs where I either changed or considered changing the exception types:
|
Uh oh!
There was an error while loading. Please reload this page.
When record array is indexed with incorrect field name it raises
ValueError
as expected:When a simple array is indexed, it raises
IndexError
as unexpected:According to this question on SO previously it was
ValueError
in both cases. Because you can not typecheck, they are bothndarrays
, it is odd to have different types of exceptions.Was this an intended change?
Also according to all this, the message for
IndexError
is not full, it does not say about fields.The text was updated successfully, but these errors were encountered: