-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Use multi-line format in @show
#22253
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
`@show` now uses a multi-line format (i.e. calls show(STDOUT, “text/plain”, …). Fix #15820 and this [Discourse issue](https://discourse.julialang.org/t/how-to-print-arrays-inside-func tions/4091). Also replaces pull request #22244
test/show.jl
Outdated
|
|
||
| # Test @show | ||
| fname = tempname() | ||
| f = open(fname, "w") |
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.
would be good to use do-blocks for some of these, including the redirection so they get put back when finished
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.
Ok I've pushed a new commit doing that. Was it why the tests did not pass?
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.
it looks like this changes some output that test/test.jl is comparing against
|
Tests are added and pass. |
|
(should be squashed, on merge if not before) |
|
Thanks! |
|
I think we should consider reverting this. |
|
I don't like how this turned out, for two reasons:
I propose bringing back #22244 ( Julia 0.6: julia> show(x)
[1, 2, 3]
julia> show(STDOUT, "text/plain", x)
3-element Array{Int64,1}:
1
2
3
julia> @show x;
x = [1, 2, 3]Julia 0.7: julia> show(x)
[1, 2, 3]
julia> show(STDOUT, "text/plain", x)
3-element Array{Int64,1}:
1
2
3
julia> @show x;
x = 3-element Array{Int64,1}:
1
2
3 |
|
Triage agrees: let's revert this. |
@shownow display objects using the multi-line format.This pull request fixes #15820 and this Discourse issue. Replaces pull request #22244