-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Misleading error when using ufuncs on large python ints #8357
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
Really, the only other thing to do is raise an error message when the number is converted to an object array. The automatic conversion of some types to object arrays causes other problems as well, and we may change that behavior at some point. |
I fully agree that this should raise an error instead of silently converting to a float number. But the error message should be a more specific. |
What would you suggest? The number gets converted to an object array that contains a long integer object. Since all types of objects can be in object arrays, the log function doesn't know how to handle it besides looking for an appropriate object method to call, which is missing in this case, and that is what the error message tells you. It is only confusing if you don't know what is going on, but the function has no idea how you got to the point where it is called, so cannot help you much in that regard. |
I think that in general, calling >>> class Foo: pass
>>> np.log10(Foo())
TypeError: Cannot call log10 on an object array when the element <__main__.Foo object at 0x000001EC87E80B00> has no 'log10' attribute |
Fixed in #12700 |
I guess this is because python's unlimited precision int cannot be transformed into a 64 bit unsigned int anymore. But the error message is very misleading on this.
The text was updated successfully, but these errors were encountered: