Base.show(::IO, ::MIME"text/plain", d::AbstractDict)
requires length(d)
#55931
Labels
collections
Data structures holding multiple items, e.g. sets
display and printing
Aesthetics and correctness of printed representations of objects.
Base.show(::IO, ::MIME"text/plain", d::AbstractDict)
for whichlength(d)
is not defined crashes.It crashes even if
Base.IteratorSize(typeof(d)) isa Base.SizeUnknown
, which is the standard way for an iterator to indicate that it doesn't supportlength
.It seems like
AbstractDict
doesn't requirelength
to be defined in general. For example,Base.summary(::IO, ::AbstractDict)
handles the case where the dictionary doesn't havelength
.Reproduction:
Then in a REPL:
It seems like
Base.show
shouldn't crash in this case.The text was updated successfully, but these errors were encountered: