Skip to content

add rand(::Type{<:Pair})#28705

Merged
rfourquet merged 1 commit intomasterfrom
rf/rand/genpair
Oct 7, 2023
Merged

add rand(::Type{<:Pair})#28705
rfourquet merged 1 commit intomasterfrom
rf/rand/genpair

Conversation

@rfourquet
Copy link
Copy Markdown
Member

This adds e.g. rand(Pair{Int,Int}) producing a random pair of Int.

@rfourquet rfourquet added the randomness Random number generation and the Random stdlib label Aug 16, 2018
@rfourquet rfourquet mentioned this pull request Aug 17, 2018
@rfourquet rfourquet changed the title add rand(::Type{<:Pair} add rand(::Type{<:Pair}) Aug 18, 2018
@ViralBShah
Copy link
Copy Markdown
Member

Do we want this or should we close?

@rfourquet
Copy link
Copy Markdown
Member Author

I still think this is useful and unambiguous as to what this should do. I find this is somewhat similar to #50251 (rand for tuple types, which I had actually also planned to implement if this PR rand(::Type{<:Pair}) was accepted), and I think the decision to merge or not should be the same for both.

@ViralBShah
Copy link
Copy Markdown
Member

May I suggest getting them both rebased and marked for triage to consider?

@rfourquet rfourquet added the triage This should be discussed on a triage call label Jul 21, 2023
@rfourquet
Copy link
Copy Markdown
Member Author

Now that #50251 is merged, I will also merge this one, as rand(Tuple{X, Y}) is so similar to rand(Pair{X, Y}).

@rfourquet rfourquet removed the triage This should be discussed on a triage call label Oct 7, 2023
@rfourquet rfourquet merged commit e4c9031 into master Oct 7, 2023
@rfourquet rfourquet deleted the rf/rand/genpair branch October 7, 2023 20:00
@fingolfin
Copy link
Copy Markdown
Member

I believe this broke RandomExtensions.jl, see JuliaRandom/RandomExtensions.jl#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

randomness Random number generation and the Random stdlib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants