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

supertype is documented to only accept a DataType when it also accepts other types #54286

Closed
LilithHafner opened this issue Apr 27, 2024 · 2 comments · Fixed by #54419
Closed
Labels
domain:docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia

Comments

@LilithHafner
Copy link
Member

julia> Vector isa DataType
false

julia> supertype(Vector)
DenseVector (alias for DenseArray{T, 1} where T)

help?> supertype
search: supertype supertypes keytype eltype subtypes isuppercase isbitstype code_typed

  supertype(T::DataType)


  Return the supertype of DataType T.

  Examples
  ≡≡≡≡≡≡≡≡

  julia> supertype(Int32)
  Signed

A good fix would be

  1. determine which types the function actually accepts
  2. edit the docstring to reflect them
@LilithHafner LilithHafner added domain:docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia labels Apr 27, 2024
@nsajko
Copy link
Contributor

nsajko commented Apr 28, 2024

Perhaps just change ::DataType into ::Type?

@nsajko
Copy link
Contributor

nsajko commented Apr 28, 2024

Actually, looking at methods(supertype), it just accepts UnionAll and DataType, so no Bottom or Union.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia
Projects
None yet
2 participants