# Improving doc for display/print/show/repr/

**URL:** <https://discourse.julialang.org/t/improving-doc-for-display-print-show-repr/69124>\
**Category:** Internals & Design\
**Tags:** documentation, io\
**Created:** [October 3, 2021, 12:59am UTC](https://discourse.julialang.org/t/improving-doc-for-display-print-show-repr/69124 "2021-10-03T00:59:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [April 2, 2024, 9:01pm UTC](https://discourse.julialang.org/t/improving-doc-for-display-print-show-repr/69124/4 "2024-04-02T21:01:48Z")

</div>

Quick summary, since this thread never seems to have concluded.

`string` calls `print` (as documented [here](https://docs.julialang.org/en/v1/base/strings/#Base.string)) which (by default) calls the 2-argument `show` (documented [here](https://docs.julialang.org/en/v1/base/io-network/#Base.print), though it doesn’t say 2-arg specifically).

`display` (by default, in the REPL) calls the 3-argument `show` with text/plain which (by default) calls 2-argument `show`. Documented in the manual’s section on [custom pretty-printing](https://docs.julialang.org/en/v1/manual/types/#man-custom-pretty-printing).

1-arg `repr` calls 2-arg `show` (documented [here](https://docs.julialang.org/en/v1/base/strings/#Base.repr-Tuple%7BAny%7D), though it doesn’t mention 2-arg specifically), and 2-arg `repr` (documented [here](https://docs.julialang.org/en/v1/base/io-network/#Base.repr-Tuple%7BMIME,%20Any%7D)) calls 3-arg `show`.

(This can all be overloaded, of course — one big exception to the above rules is for strings, in which case `show` and hence `repr` add quotation marks and backslash escaping of special characters, whereas `print` just outputs the raw string. This is mentioned in the `print` docs.)

The big omission from the docs is that the `print` and 1-arg `repr` functions just say that they call `show`, but should specifically say that they call the 2-argument `show`. I think this is because those functions pre-date the 3-arg `show`. PR to fix this omission: [document that print(x) and repr(x) call 2-arg show by stevengj · Pull Request #53927 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/53927)

---

_[View the full topic](https://discourse.julialang.org/t/improving-doc-for-display-print-show-repr/69124)._
