Skip to content

MIME-less show should return valid Julia code #5

@nsajko

Description

@nsajko

This is not correct:

# Base show method (without MIME) - delegates to text/plain
function Base.show(io::IO, A::NDSparseArray{T, N}) where {T, N}
return show(io, MIME"text/plain"(), A)
end
# Improved display with better formatting
function Base.show(io::IO, ::MIME"text/plain", A::NDSparseArray{T, N}) where {T, N}

As the doc string says:

The representation used by show generally includes Julia-specific formatting and type information, and should be parseable Julia code when possible.

[...]

For a more verbose human-readable text output for objects of type T, define show(io::IO, ::MIME"text/plain", ::T) in addition.

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