问题
If I have an array of numbers:
a = [1,2,3]
and print it, I get
[1,2,3]
but if I have an array of, say, Tuples:
b = [(1,2),(3,)]
when I print it I get:
Tuple{Int64,Vararg{Int64}}[(1,2),(3,)]
How to avoid printing the types?
回答1:
It cannot be suppressed.
julia> b = [(1,2), (3,)]
2-element Array{Tuple{Int64,Vararg{Int64}},1}:
(1,2)
(3,)
Maybe the type is being printed to show you that you are including a Vararg
type.
If you want an output without the message, you can go ahead and write a wrapper for Base.show
来源:https://stackoverflow.com/questions/35536437/how-to-not-print-types-in-julia