-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Improve Parameter error messages #808
Conversation
@philippjfr this is ready. |
Thanks. Now seems like a good chance to make the error message a bit cleaner. Instead of ", not type <class 'str'>", can it be either ", not <class 'str'>", or ", not type 'str'", (my preference, I think)? I'm a bit confused why it comes out that way right now, as if I do "type('st')" I get "str", not the confusing version. |
Yes that'd be a good idea! I won't have time to take care of that now though. |
Ah, apparently Python only shows the |
Personally I find |
Co-authored-by: Philipp Rudiger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes!
The error messages raised by Parameters are pretty inconsistent and often lack context.
For now with this PR I'm just seeking feedback on a utility I've added that builds a message supposed to prefix most of (if not all) the errors raised by Parameters. I've just adapted the type validation performed by
Number
to show the error messages emitted in various situations:(I'd hope to get this into the 2.0 release.)