Skip to content

the future of Random.gentype #31968

@tpapp

Description

@tpapp

Random.gentype was introduced in #27756, so that custom random samplers would not have to use Base.eltype for returning element types, but the former falls back to the latter.

In the discussion of the recent docs cleanup PR #31787 it was unclear whether to make Random.gentype part of the API.

It would be great to decide

  • whether Random.gentype(sampler) or Base.eltype(sampler) should be the API for querying typeof(rand(sampler)), especially if sampler is not a collection.
  • whether Random.gentype is needed at all, or should be removed from the internal code, too.

@rfourquet, please comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    randomnessRandom number generation and the Random stdlib

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions