From 85c96b9c4597b6f3c51e879acd7ed990cf5cbe4e Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 21 Sep 2023 05:07:11 -0400 Subject: [PATCH] define `show` instead of `repr` in BinaryPlatforms (#51398) Co-authored-by: Keno Fischer --- base/binaryplatforms.jl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/base/binaryplatforms.jl b/base/binaryplatforms.jl index 913dc51426eef..b374d57ce9731 100644 --- a/base/binaryplatforms.jl +++ b/base/binaryplatforms.jl @@ -170,20 +170,18 @@ end # Allow us to easily serialize Platform objects -function Base.repr(p::Platform; context=nothing) - str = string( - "Platform(", - repr(arch(p)), - ", ", - repr(os(p)), - "; ", - join(("$(k) = $(repr(v))" for (k, v) in tags(p) if k ∉ ("arch", "os")), ", "), - ")", - ) +function Base.show(io::IO, p::Platform) + print(io, "Platform(") + show(io, arch(p)) + print(io, ", ") + show(io, os(p)) + print(io, "; ") + join(io, ("$(k) = $(repr(v))" for (k, v) in tags(p) if k ∉ ("arch", "os")), ", ") + print(io, ")") end # Make showing the platform a bit more palatable -function Base.show(io::IO, p::Platform) +function Base.show(io::IO, ::MIME"text/plain", p::Platform) str = string(platform_name(p), " ", arch(p)) # Add on all the other tags not covered by os/arch: other_tags = sort!(filter!(kv -> kv[1] ∉ ("os", "arch"), collect(tags(p))))