# Display() of an Array type showing unwanted info

**URL:** https://discourse.julialang.org/t/display-of-an-array-type-showing-unwanted-info/55016
**Category:** General Usage
**Created:** [February 10, 2021, 6:27pm UTC](https://discourse.julialang.org/t/display-of-an-array-type-showing-unwanted-info/55016 "2021-02-10T18:27:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [February 10, 2021, 6:27pm UTC](https://discourse.julialang.org/t/display-of-an-array-type-showing-unwanted-info/55016/1 "2021-02-10T18:27:21Z")

</div>

Hello

Here is a snippet that illustrates my problem:

```julia
const Asn = Array{Tuple{String,Int64},1}
Base.summary(io::IO, x::Asn) = 
    print(io, *([s[1] for s in x]...), " = ", *([s[2] for s in x]...))
Base.show(io::IO, x::Asn) = print(io, summary(x))

x = Asn([("a",1),("b",2),("c",3)]);
display(x)

```

The output of this code is:

```julia
abc = 6:
 ("a", 1)
 ("b", 2)
 ("c", 3)

```

I would like to have this shorter output instead, similar to a print(x):

```julia
abc = 6

```

Would you have some suggestion on how to do this?  
Also, I would like to understand why the extra lines comes in the display.

Thanks,

Michel

---

<div class="post-metadata">

### Author: ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)
#### Post date: [February 10, 2021, 8:33pm UTC](https://discourse.julialang.org/t/display-of-an-array-type-showing-unwanted-info/55016/2 "2021-02-10T20:33:52Z")

</div>

`print(x)` calls your 2-arg show method, but `display` calls this 3-arg method: `@less show(stdout, MIME"text/plain"(), x)`. Which uses your `summary`, before printing the array contents as usual. So you need to overload `Base.show(io::IO, ::MIME"text/plain", x::Asn) = ...` to change that.

---

<div class="post-metadata">

### Author: ![maajdl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maajdl/32/22838_2.png) [@maajdl](https://discourse.julialang.org/u/maajdl)
#### Post date: [February 10, 2021, 8:43pm UTC](https://discourse.julialang.org/t/display-of-an-array-type-showing-unwanted-info/55016/3 "2021-02-10T20:43:28Z")

</div>

Thanks! It works!
