Julia: Better printing of `zip` output

Created on 28 Oct 2019  Â·  7Comments  Â·  Source: JuliaLang/julia

The printing of zip is quite unreadable for even simple arguments:

julia> zip((:a,:b,:c), (1,2,3))
Base.Iterators.Zip{Tuple{Tuple{Symbol,Symbol,Symbol},Tuple{Int64,Int64,Int64}}}(((:a, : :c), (1, 2, 3)))

Can we include better printing of zip outputs so that for interactive sessions, it's easier to scan?

Most helpful comment

Sure, should be easy enough. My suggestion is to print it as it's called, i.e. just

zip((:a, :b, :c), (1, 2, 3))

All 7 comments

Sure, should be easy enough. My suggestion is to print it as it's called, i.e. just

zip((:a, :b, :c), (1, 2, 3))

Sounds good to me. Do we do that for any other types ?

Sometimes, c.f. showarg & such

Also typeof(+) and so on.

Would it be good to do this with all functions from Base.Iterators? Or at least the ones that are imported into Base?

skipmissing would probably benefit from this too.

Relevant issue here regarding best practices for the two argument show method.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StefanKarpinski picture StefanKarpinski  Â·  3Comments

iamed2 picture iamed2  Â·  3Comments

StefanKarpinski picture StefanKarpinski  Â·  3Comments

felixrehren picture felixrehren  Â·  3Comments

yurivish picture yurivish  Â·  3Comments