Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs for sort refer to Base.copymutable, but the latter is not in the manual #51932

Closed
nsajko opened this issue Oct 30, 2023 · 2 comments · Fixed by #52098
Closed

docs for sort refer to Base.copymutable, but the latter is not in the manual #51932

nsajko opened this issue Oct 30, 2023 · 2 comments · Fixed by #52098

Comments

@nsajko
Copy link
Contributor

nsajko commented Oct 30, 2023

Uses Base.copymutable to support immutable collections and iterables.

If Base.copymutable is an internal function, why does the sort doc refer to it? Should Base.copymutable be made public?

@nsajko
Copy link
Contributor Author

nsajko commented Oct 30, 2023

FTR, if it does get made public, it probably needs a better doc string, because I'm not sure how is one supposed to use it and/or overload it by reading the doc string.

Also, FWIW, Base.copymutable is used already in StaticArrays.

@LilithHafner
Copy link
Member

LilithHafner commented Oct 30, 2023

In 1.9 the docstring for sort did not include this sentence, so it's not too late to keep copymutable internal. That said, it seems like sensible functionality to make public.

Also, the new docstring for sort! is objectively false for tuples because copymutable returns a Vector when passed a tuple and sort(::NTuple) returns an NTuple.

jishnub pushed a commit that referenced this issue Nov 10, 2023
Two chagnes wrapped into one `Base.copymutable` => `Base.copymutable` &
`collect` and `Base.copymutable` => `similar` & words.

Followup for #52086 and #46104; also fixes #51932 (though we still may
want to make `copymutable` public at some point)

---------

Co-authored-by: Jameson Nash <[email protected]>
KristofferC pushed a commit that referenced this issue Nov 13, 2023
Two chagnes wrapped into one `Base.copymutable` => `Base.copymutable` &
`collect` and `Base.copymutable` => `similar` & words.

Followup for #52086 and #46104; also fixes #51932 (though we still may
want to make `copymutable` public at some point)

---------

Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 42c088b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants