# Cannot call \`show(io,MIME...\`

**URL:** <https://discourse.julialang.org/t/cannot-call-show-io-mime/55158>\
**Category:** General Usage\
**Created:** [February 12, 2021, 3:51pm UTC](https://discourse.julialang.org/t/cannot-call-show-io-mime/55158 "2021-02-12T15:51:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Michel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jean_michel/32/8282_2.png) [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Post date:** [February 12, 2021, 3:51pm UTC](https://discourse.julialang.org/t/cannot-call-show-io-mime/55158/1 "2021-02-12T15:51:31Z")

</div>

I am surprised by the following

```julia
julia> struct Thing end

julia> x=Thing()
Thing()

julia> Base.show(io::IO,::MIME"text/plain",x::Thing)=print(io,"hello")

julia> show(stdout,MIME"text/plain",x)
ERROR: MethodError: no method matching show(::Base.TTY, ::Type{MIME{Symbol("text/plain")}}, ::Thing)
Closest candidates are:
  show(::IO, ::MIME{Symbol("text/plain")}, ::Thing) at REPL[3]:1
  show(::IO, ::MIME{Symbol("text/plain")}, ::Any) at multimedia.jl:47
  show(::IO, ::MIME{Symbol("text/csv")}, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/DelimitedFiles/src/DelimitedFiles.jl:828
  ...
Stacktrace:
 [1] top-level scope at REPL[4]:1

```

How to call the method of `show` I just defined?

---

<div class="post-metadata">

**Author:** ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)\
**Post date:** [February 12, 2021, 3:54pm UTC](https://discourse.julialang.org/t/cannot-call-show-io-mime/55158/2 "2021-02-12T15:54:04Z")

</div>

> [@Jean\_Michel](#):
>
> `show(stdout,MIME"text/plain",x)`

The function expects an instance of the MIME type, not the type itself.

```julia
julia> show(stdout,MIME"text/plain"(),x)
hello

```

Alternative:

```julia
julia> show(stdout,"text/plain",x)
hello

```

---

<div class="post-metadata">

**Author:** ![Jean\_Michel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jean_michel/32/8282_2.png) [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Post date:** [February 12, 2021, 3:54pm UTC](https://discourse.julialang.org/t/cannot-call-show-io-mime/55158/3 "2021-02-12T15:54:41Z")

</div>

Thanks. I was confused about MIME strings
