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

dpsanders picture dpsanders  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

ararslan picture ararslan  路  3Comments

omus picture omus  路  3Comments

TotalVerb picture TotalVerb  路  3Comments