Skip to content

Commit

Permalink
RandomDevice(unlimited::Bool) to RandomDevice(; unlimited::Bool) (#25668
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rfourquet authored and JeffBezanson committed Jan 22, 2018
1 parent 92bf8fd commit 4873dc0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,9 @@ Deprecated or removed

* The module `Random.dSFMT` is renamed `Random.DSFMT` ([#25567]).

* `Random.RandomDevice(unlimited::Bool)` (on non-Windows systems) is deprecated in favor of
`Random.RandomDevice(; unlimited=unlimited)` ([#25668]).

* The generic implementations of `strides(::AbstractArray)` and `stride(::AbstractArray, ::Int)`
have been deprecated. Subtypes of `AbstractArray` that implement the newly introduced strided
array interface should define their own `strides` method ([#25321]).
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Random/src/RNGs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else # !windows
file::IOStream
unlimited::Bool

RandomDevice(unlimited::Bool=true) =
RandomDevice(; unlimited::Bool=true) =
new(open(unlimited ? "/dev/urandom" : "/dev/random"), unlimited)
end

Expand All @@ -34,7 +34,7 @@ else # !windows
end
function deserialize(s::AbstractSerializer, t::Type{RandomDevice})
unlimited = deserialize(s)
return RandomDevice(unlimited)
return RandomDevice(unlimited=unlimited)
end

end # os-test
Expand Down
3 changes: 3 additions & 0 deletions stdlib/Random/src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ end
# PR #25429
@deprecate rand(r::AbstractRNG, dims::Dims) rand(r, Float64, dims)
@deprecate rand( dims::Dims) rand(Float64, dims)

# PR #25668
@deprecate RandomDevice(unlimited::Bool) RandomDevice(; unlimited=unlimited)

0 comments on commit 4873dc0

Please sign in to comment.