The current error message: TypeError: '>' not supported between instances of 'NoneType' and 'int'
Changes
New error message says which dimension had an issue and makes clear that it is user error: TypeError: Dimensions not in output must be integers. Got NoneType for C.
Code now does what the comment "Check that integer" suggests
Implementation notes
We're checking against Integral instead of int because Integral is more general, including numpy integers, for example.
Testing
I ran the following script. I didn't add a unit test because the error class (TypeError) remains the same.
Issue
I wrote some incorrect code that was a little hard to debug because the error message lacked detail.
Simplified example
The current error message:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Changes
TypeError: Dimensions not in output must be integers. Got NoneType for C.
Implementation notes
We're checking against
Integral
instead ofint
becauseIntegral
is more general, including numpy integers, for example.Testing
I ran the following script. I didn't add a unit test because the error class (TypeError) remains the same.