Add custom method to Base.show

Using display instead of println is one way, though I would probably do something like

julia> Base.show(io::IO, a::A) = show(io, a.dict) # For one-line printing

julia> Base.show(io::IO, ::MIME"text/plain", a::A) = show(io, "text/plain", a.dict) # For multiline printing

(And I would also make sure the printed information explains that a is not a Dict, but wraps one.)

See Custom pretty-printing for more details.

1 Like