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

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

Merged
merged 1 commit into from
Oct 7, 2023
Merged

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

merged 1 commit into from
Oct 7, 2023

Conversation

rfourquet
Copy link
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
Member

Do we want this or should we close?

@rfourquet
Copy link
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
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
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
4 of 7 checks passed
@rfourquet rfourquet deleted the rf/rand/genpair branch October 7, 2023 20:00
@fingolfin
Copy link
Contributor

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