Skip to content

join docstring is wrong w.r.t AnnotatedStringss #55382

Open
@KristofferC

Description

The docstring for join says:

join([io::IO,] iterator [, delim [, last]])
Each item of iterator is converted to a string via print(io::IOBuffer, x).
If io is given, the result is written to io rather than returned as a String.

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 an AnnotatedString the result is also an AnnotatedString, otherwise the result is a String

Activity

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

Metadata

Assignees

No one assigned

    Labels

    docsThis change adds or pertains to documentationstrings"Strings!"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions