# Modify show for custom type - for tuples

**URL:** <https://discourse.julialang.org/t/modify-show-for-custom-type-for-tuples/9571>\
**Category:** General Usage\
**Created:** [March 7, 2018, 3:22pm UTC](https://discourse.julialang.org/t/modify-show-for-custom-type-for-tuples/9571 "2018-03-07T15:22:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [March 7, 2018, 3:22pm UTC](https://discourse.julialang.org/t/modify-show-for-custom-type-for-tuples/9571/1 "2018-03-07T15:22:21Z")

</div>

I have a function which returns a 2-tuple. One of the elements of the tuple is an ‘instance’ of a custom type.  
For this type I have overloaded the show function.  
But when I run the function which returns a tuple, it falls back to the ‘default show’

Can someone help me with this?

See my MWE

```julia
mutable struct Mine
    x::Int64
    secret::Int64
end

m=Mine(2,3)

m #->ouput is Mine(2,3) as expected

function Base.show(io::IO, t::MIME"text/plain",x::Mine)
    #this is be my custom show function
    println(io,x.x)
end

m # terminal shows 2
#I successfully modified show, as intended

#a meaningless function
function do_something(x::Mine)
    y=deepcopy(x)    
    return "some string",y
end

a=do_something(m)
#here a is printed as ("some string", Mine(2, 3))
#I want it to be printed as ("some string", 2)

#I tried to look at these, but could not solve my problem
#@which show(m)
#@which show(("asd",m))

```

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [March 7, 2018, 4:13pm UTC](https://discourse.julialang.org/t/modify-show-for-custom-type-for-tuples/9571/2 "2018-03-07T16:13:38Z")

</div>

I don’t really understand this Mime stuff, but I believe that what you want is to also overload `Base.show(io::IO, x:: Mine)` with the one-like printed version of your type.
