Skip to content

Commit

Permalink
clarifications on display vs show (JuliaLang#24513)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored and ararslan committed Nov 8, 2017
1 parent 10ab2be commit 3077732
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/multimedia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ richest supported multimedia output for `x`, with plain-text [`STDOUT`](@ref) ou
The `display(d, x)` variant attempts to display `x` on the given display `d` only, throwing
a [`MethodError`](@ref) if `d` cannot display objects of this type.
In general, you cannot assume that `display` output goes to `STDOUT` (unlike [`print(x)`](@ref) or
[`show(x)`](@ref)). For example, `display(x)` may open up a separate window with an image.
`display(x)` means "show `x` in the best way you can for the current output device(s)."
If you want REPL-like text output that is guaranteed to go to `STDOUT`, use
[`show(STDOUT, "text/plain", x)`](@ref) instead.
There are also two variants with a `mime` argument (a MIME type string, such as
`"image/png"`), which attempt to display `x` using the requested MIME type *only*, throwing
a `MethodError` if this type is not supported by either the display(s) or by `x`. With these
Expand Down

0 comments on commit 3077732

Please sign in to comment.