-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Document supertype(T::UnionAll) (#54286) #54391
Conversation
base/operators.jl
Outdated
@@ -68,12 +68,16 @@ Supertype operator, equivalent to `T2 <: T1`. | |||
""" | |||
supertype(T::DataType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this consistent with the text below. So it should be, e.g., supertype(T::Union{DataType,UnionAll})
, I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think usually when there's more than one method there's no type annotation? No idea ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would maybe be best to put supertype(T::Type)
here, but clarify in the description below that only UnionAll and DataType are accepted. You could also explicitly tell that Union
s aren't allowed.
base/operators.jl
Outdated
@@ -68,12 +68,16 @@ Supertype operator, equivalent to `T2 <: T1`. | |||
""" | |||
supertype(T::DataType) | |||
|
|||
Return the supertype of DataType `T`. | |||
Return the supertype of type `T`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use the definite article here, a type may have more than one supertype. Not sure what the best wording is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen direct supertype around (e.g. oracle docs), would that work?
base/operators.jl
Outdated
@@ -68,12 +68,16 @@ Supertype operator, equivalent to `T2 <: T1`. | |||
""" | |||
supertype(T::DataType) | |||
|
|||
Return the supertype of DataType `T`. | |||
Return the supertype of type `T`. | |||
`T` can be a `DataType` or a `UnionAll` type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this sentence isn't very useful, given that the allowed argument type should be indicated in the signature above anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it could be good to xref DataType
and UnionAll
. Like this:
[`DataType`](@ref)
[`UnionAll`](@ref)
…uliaLang#54362) This fixes JuliaLang#54360 by moving the interpreter's cache of `@generated` results from `mi.uninferred` into `mi.cache` with a separate cache owner to partition the cache from regular inference results. There are two other uses of the `mi.uninferred` field: 1. As the place to store uninferred code for temporary top-level thunks 2. Is an uncompressed copy of m->source to avoid having to re-uncompress every time in the interpreter. In this PR, use case 1 is changed to use the same mechanism as generated functions. Use case 2 is changed to just uncompress the source in place in m->source. As a result, the `uninferred` field is unused and removed. Note that I'm planning a somewhat larger refactor of `MethodInstance` in the immediate future, so this might be a somewhat shortlived representation, but that change should hopefully by largely transparent to users of the wrappers introduced here.
Fixes JuliaLang#54142. Also documents the `firstindex(dst) == firstindex(src)` check, since the `axes(dst) == axes(src)` is already documented.
…54386) There's no need to specialize this code for every set of Tuple types that it might see, especially when the primary callers don't know their Tuple type any more precisely than this anyway. Eliminates a dynamic dispatch from `tryparse(VersionNumber, "...")` Co-authored-by: Gabriel Baraldi <baraldigabriel@gmail.com>
Following on from JuliaLang#54346, this marks the `ccall` in `category_code` as foldable. This lets us compute the results of several functions at compile time, such as: ```julia julia> @code_typed (() -> isletter('C'))() CodeInfo( 1 ─ return true ) => Bool julia> @code_typed (() -> isnumeric('C'))() CodeInfo( 1 ─ return false ) => Bool julia> @code_typed (() -> ispunct('C'))() CodeInfo( 1 ─ return false ) => Bool ```
Co-authored-by: Ashley Milsted <ashmilsted@gmail.com>
Fixes JuliaLang#54375 --------- Co-authored-by: Shuhei Kadowaki <aviatesk@gmail.com>
…aLang#54406) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: main Julia branch: master Old commit: cb602d7 New commit: a09f90b Julia version: 1.12.0-DEV SparseArrays version: 1.12.0 Bump invoked by: @dkarrasch Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@cb602d7...a09f90b ``` $ git log --oneline cb602d7..a09f90b a09f90b Adjust matvec and matmatmul! to new internal LinAlg interface (JuliaLang#519) 3b30333 ci: run aqua test as a standalone ci job (JuliaLang#537) df0a154 Add versioned Manifest files to .gitignore (JuliaLang#534) 4606755 Extend `copytrito!` for a sparse source (JuliaLang#533) 33fbc75 SparseMatrixCSC constructor with a Tuple of Integers (JuliaLang#523) 08d6ae1 CI: don't run `threads` tests in Windows GHA CI (attempt 2) (JuliaLang#530) 7408e4b Revert "Don't fail CI if codecov upload fails." (JuliaLang#527) 287e406 Bump julia-actions/setup-julia from 1 to 2 (JuliaLang#524) b5de0da Don't fail CI if codecov upload fails. (JuliaLang#525) 78dde4c cast to Float64 directly instead of using float (JuliaLang#521) a5e95ec CI: Add Apple Silicon (macOS aarch64) to the CI matrix (JuliaLang#505) ``` Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
I found that julia was missing some useful music notation unicode completions and sometimes [had to copy and paste these unicodes to use the published package](JuliaMusic/MusicTheory.jl#27). So I picked out some unicode music symbols that might be useful, named from the [unicode standard](https://www.unicode.org/charts/PDF/U1D100.pdf). I didn't add the test, I don't think it's necessary. Thanks for reviewing. Please reply if any changes are needed. --------- Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com>
I didn't force... I can re-open if needed. The actual changes are only in |
Probably worth re-opening. or force pushing back to b64c581 |
Simply run EDIT: disregard, I see you already opened a new PR: #54419 |
Fixes #54286.
Does this seem reasonable, or is it too minimal, considering that people using
supertype
might not have any idea whatUnionAll
s are, and it should at least point to their (developer) documentation, or explain them further?