Why are `seed!` and `default_rng` not public?

julia> VERSION
v"1.11.0-rc1"

julia> using Random

julia> Base.ispublic(Random, :seed!), Base.ispublic(Random, :default_rng)
(false, false)

Does this mean that one should avoid using these functions if the code should be compatible with future Julia versions?

If so, then what is a sensible alternative to something like:

using Random

myfunction(rng::AbstractRNG, n::Integer)
    rand(rng, 1:55, n, 2 * n)
end

myfunction(n::Integer)
    myfunction(Random.default_rng(), n)
end

They just haven’t been marked as public yet. This is being tracked over Correctly mark all symbols as `public` or not · Issue #51335 · JuliaLang/julia · GitHub apparently

3 Likes