-
Notifications
You must be signed in to change notification settings - Fork 190
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
Prettyerrors #844
base: master
Are you sure you want to change the base?
Prettyerrors #844
Conversation
end | ||
|
||
function Base.showerror(io::IO, e::PyError) | ||
println(io, "PyError:\n", pystr_nofail(e.val)) |
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.
This line is crucial. e.val
is the python exception object. And the question is how should we print it. Master does it calling repr
. From looking at some tutorials, it seems that calling str
is preferred. But I am by no means sure if it is the best analog of showerror
in python. Or if it even depends on the python version, what's the preferred thing.
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.
The code is a bit quick and dirty and there are no tests. I would like to have some feedback about how errors should look like and if this is the right approach, before I clean it up.
Is there interest in this PR? |
@stevengj can you briefly comment if there is interest in this PR? So I know if I should polish / redesign / abandon it. |
On master the following snippet:
gives
This is hard to read. See also #843 . With this PR it becomes: