join
docstring is wrong w.r.t AnnotatedStrings
s #55382
Open
Description
opened on Aug 5, 2024
The docstring for join
says:
join([io::IO,] iterator [, delim [, last]])
Each item ofiterator
is converted to a string viaprint(io::IOBuffer, x)
.
Ifio
is given, the result is written toio
rather than returned as aString
.
This is now not true because an AnnotatedString
turns into a String
when printed and extracted from an IOBuffer
and the docstring says the result should be a String
which is no longer true:
julia> s1 = Base.AnnotatedString("abc def", [(1:3, :face=>:yellow)])
"abc def"
julia> join(s1) |> typeof
Base.AnnotatedString{String}
AFAIU, the docstring should now be something like:
If any element of
iterator
is anAnnotatedString
the result is also anAnnotatedString
, otherwise the result is aString
Activity