# What function (display?) does IJulia call at the end of each cell?

**URL:** https://discourse.julialang.org/t/what-function-display-does-ijulia-call-at-the-end-of-each-cell/33554
**Category:** General Usage
**Tags:** jupyter
**Created:** [January 19, 2020, 2:58pm UTC](https://discourse.julialang.org/t/what-function-display-does-ijulia-call-at-the-end-of-each-cell/33554 "2020-01-19T14:58:22Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [January 19, 2020, 5:49pm UTC](https://discourse.julialang.org/t/what-function-display-does-ijulia-call-at-the-end-of-each-cell/33554/2 "2020-01-19T17:49:21Z")

</div>

> [@JeffFessler](#):
>
> I have an `AbstractArray` type with its own `display` method that gets called correctly in the REPL but in Jupyter/IJulia whatever function is called to display the last argument in each cell is apparently calling a default display type for `AbstractArray` rather than my object’s specialized method. What `display` type function is called at the end of each cell?

IJulia calls `display`, but with its own `AbstractDisplay` type, so your method isn’t being called.

The problem is that **you shouldn’t be overriding `display`** in the first place. You should override `show`, as [is explained in the manual](https://docs.julialang.org/en/latest/manual/types/#man-custom-pretty-printing-1). For example:

```julia
Base.show(io::IO, s::SqrV) = print(io, "SV1 count=$(s.count)")
Base.show(io::IO, m::MIME"text/plain", s::SqrV) = print(io, "SV2 $(s.count)")

```

Then if you do `print(s)` it will use the first method, whereas REPL `display` and IJulia will use the second method, as is explained in the manual.

Note that you want to call `print(io, ...)` in `show`, not `println(....)`. First, `show` output does not typically include a trailing newline (that is added when `show` is called, e.g. by `println`). Second, you want to output to the supplied `io` stream — that way your custom `show` method can work with streams besides `stdout` (e.g. output to a file or buffer).

---

_[View the full topic](https://discourse.julialang.org/t/what-function-display-does-ijulia-call-at-the-end-of-each-cell/33554)._
