Random Non-Uniform Distributions

June 6, 2025 ยท View on GitHub

  • Stage 0
  • Authors: WhosyVox and Tab Atkins-Bittner
  • Champions: Tab Atkins-Bittner
  • Spec Text: currently this README

This proposal introduces several new functions for sampling from non-uniform random distributions. This proposal stands alongside Simple Random Functions and Random Collection Functions, and like those, uses the Random namespace object introduced by Seeded Random.

Distribution Methods

Python includes a decent selection of distributions. We should probably at least include the normal/gaussian distribution, given its high degree of usefulness. Should we include more? All of Python's distributions? Other distributions?

Interaction with Random.Seeded

All of the above functions will also be defined on the Random.Seeded class as methods, with identical signatures and behavior. That is, Random.normal(...) and new SeededRandom(...).normal(...) will both work.

Precise generation algorithms will be defined for the Random.Seeded methods, to ensure reproducibility. It's recommended that the Random versions use the same algorithm, but not strictly required; doing so just lets you use an internal Random.Seeded object and avoid implementing the same function twice.

History

  • 2025-06: Split out from Random Functions as part of the condition for that proposal advancing to Stage 1.