Skip to content

Making display style consistent with Base #188

Description

@kimikage

Thanks to the JuliaLang/julia#36107, Julia nightly (1.6.0-DEV) now uses the exported type-aliases (e.g. N0f8) for printing types.

Julia 1.4.2

julia> N0f8
Normed{UInt8,8}

julia> N0f8[0, 1]
2-element Array{N0f8,1} with eltype Normed{UInt8,8}:
 0.0N0f8
 1.0N0f8

julia> Float32[0, 1]
2-element Array{Float32,1}:
 0.0
 1.0

Julia 1.6.0-DEV.356

julia> N0f8
N0f8 = Normed{UInt8,8}

julia> N0f8[0, 1] # the summary is customized and the elements don't check :typeinfo
2-element Array{N0f8,1} with eltype N0f8:
 0.0N0f8
 1.0N0f8

julia> Float32[0, 1]
2-element Vector{Float32}:
 0.0
 1.0

I think we should avoid unnecessary customization on Julia v1.6 and above. Also, FixedPointNumbers.showtype should be more strict.

julia> FixedPointNumbers.showtype(stdout, N0f8);
N0f8
julia> FixedPointNumbers.showtype(stdout, Normed{UInt128,8});
N120f8
julia> N120f8
ERROR: UndefVarError: N120f8 not defined

julia> FixedPointNumbers.showtype(stdout, Normed{UInt8, Int32(8)}); # cf. #162
N0f8

In the next minor update of ColorTypes (i.e. v0.11), the display bug of AGray32 will be fixed. In line with that, I plan to revise the display of Color Types as well. (cf. JuliaGraphics/ColorTypes.jl#191, JuliaGraphics/ColorTypes.jl#202)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions