-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Better error messages for type callable #8039
Comments
I'm not sure whether it's worth to try to improve this; new code should preferably use the first-class callable syntax, which gives the desired information. And in the long run, the callable syntax should be deprecated, in my opinion. |
Since there have been no further comments, I assume this is a WONTFIX. |
I just ran into this with That |
Same issue here, I ran into this error a few times and it is quite misleading. |
The same situation. Lost an hour looking in the wrong direction. |
By the way, mistyping the function name in the string is enough to experience this. |
Description
I deliberately avoid the callable type in my code because it produces misleading error messages.
Examples:
Not only does the error message not tell you exactly what is wrong with the callback, but it is also little misleading. Message Must be callable, array given suggests, that something other than array (or string) was expected.
Thanks for your consideration.
The text was updated successfully, but these errors were encountered: