Open Seelengrab opened 1 year ago
I have to say that I don't know much about the show-internals, so it could well be that there can be improvements. Are you an expert?
So @kwdef
changes the show behaviour, right?
For me, the different @show
is kinda disturbing my workflow since I can't simply copy paste the printed object into the REPL such that it is valid Julia code again.
Is there a way to turn it off?
EDIT -> https://mauro3.github.io/Parameters.jl/dev/api/#Parameters.@with_kw_noshow-Tuple{Any}
julia> using Parameters
julia> struct Lel
a
end
julia> @with_kw struct Lel2
a
end
Lel2
julia> @show Lel(1.0)
Lel(1.0) = Lel(1.0)
Lel(1.0)
julia> @show Lel2(1.0)
Lel2(1.0) = Lel2
a: Float64 1.0
Lel2
a: Float64 1.0
https://github.com/mauro3/Parameters.jl/blob/e55b025b96275142ba52b2a725aedf460f26ff6f/src/Parameters.jl#L581-L588
This seems dangerous, bypassing the whole
show
machinery. Not to mention,limit
should already be set by default in the REPL if I'm not mistaken. This seems more appropriate, giving the same behavior but with the documented interface:I'm not sure always passing
:limit => true
is a good idea, since that may have been set explicitly tofalse
in the passed inIO
.