-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Append newline to the end of dump methods #17202
Conversation
@@ -1158,6 +1168,7 @@ function dumptype(io::IO, x::ANY, n::Int, indent) | |||
end | |||
end | |||
end | |||
isempty(indent) && println(io) | |||
end |
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.
Maybe all the dump
methods should explicitly return nothing?
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.
Yes; otherwise they return false
which doesn't really make sense.
LGTM. Anyone else have thoughts? |
Would be nice to get this merged. |
@@ -500,3 +500,9 @@ let s = IOBuffer(Array{UInt8}(0), true, true) | |||
Base.showarray(s, [1,2,3], false, header = false) | |||
@test String(resize!(s.data, s.size)) == " 1\n 2\n 3" | |||
end | |||
|
|||
# The `dump` function should alway have a trailing newline |
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.
always
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. I'll take care of that in another PR
* Append newline to the end of dump methods * Made dump methods return nothing
The doctest system doesn't deal very well with examples that don't have a trailing newline. Originally mentioned in #17106 and in the julia-dev forums
This is my first time making modifications to the
dump
methods. Let me know if there's something I didn't consider.