-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add Type to bad args output #518
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
Conversation
|
What about using |
|
@dean0x7d - you mean simply instead of the type + value pair? I thought it might be nice to have both type and value, even if it is redundant sometimes (like None, Pet). |
|
But yeah, perhaps just |
|
Yeah, just |
|
While it's nicer than |
|
@pschella - thoughts? |
|
In most cases >>> import datetime
>>> now = datetime.datetime.now()
>>> str(now)
2016-11-21 21:32:47.664461
>>> repr(now)
datetime.datetime(2016, 11, 21, 21, 32, 47, 664461)
>>> then = eval(repr(now))
>>> str(then)
2016-11-21 21:32:47.664461The examples in the tests are mostly builtin types which can be trivially reconstructed. That's why >>> s = "hello"
>>> str(s)
hello
>>> repr(s)
'hello'
>>> eval(str(s))
NameError: name 'hello' is not defined
>>> eval(repr(s))
hello |
This gives more informative output, often including the type (or at least some hint about the type).
be6f5e9 to
f0ee877
Compare
|
Okay, I'm convinced :) Updated to just switch to |
The changes the error message for invalid arguments to display
Type (= strvalue)instead of juststrvaluefor the given argument list.Fixes #517.