-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix #4163, remove xdump
and simplify dump
#15707
Conversation
else | ||
println(io, undef_ref_str) | ||
end | ||
for field in (isa(x,Tuple) ? (1:length(x)) : fieldnames(T)) |
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.
should probably always be 1:nfields(T)
, since the indices are unique and always available
One remaining issue is that |
So, julia> d = Dict(:a => 1, :b => Dict(:x => Dict(:y => [2,3], :z => 3)))
Dict{Symbol,Any} with 2 entries:
:a => 1
:b => Dict(:x=>Dict{Symbol,Any}(:y=>[2,3],:z=>3))
julia> dump(d)
Dict{Symbol,Any} len 2
a: Int64 1
b: Dict{Symbol,Dict{Symbol,Any}} len 1
x: Dict{Symbol,Any} len 2
y: Array(Int64,(2,)) [2,3]
z: Int64 3
julia> show(d)
Dict{Symbol,Any}(:a=>1,:b=>Dict(:x=>Dict{Symbol,Any}(:y=>[2,3],:z=>3))) If I follow this right, that output of |
That strikes me as just an aesthetic difference of opinion on how Dicts
should be printed. I think it could be handled by verbosity levels in show.
Actually the AbstractTrees package provides something like this, with much
nicer output to boot.
|
Can this be merged? |
Is anything not mentioned here stopping this from being merged? If not, I'd be up for branching off this and fixing it up for a merge. |
Basically just needs a rebase and a NEWS entry. I'll do that and merge. |
@@ -1692,7 +1692,7 @@ split | |||
""" | |||
dump(x) | |||
|
|||
Show all user-visible structure of a value. | |||
Show every part of the representation of a value. |
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.
please run genstdlib and commit updates at the same time
several places in docs need fixing |
What else needs fixes past |
|
For JuliaLang#15707. In addition: * Some commented out code referring to `xdump` was removed from `base/show.jl`. * `doc/stdlib/arrays.rst` was updated from building docs.
For JuliaLang#15707. In addition: * Some commented out code referring to `xdump` was removed from `base/show.jl`. * `doc/stdlib/arrays.rst` was updated from building docs.
This replaces these functions with a single one that just shows everything inside an object.
Some examples: