Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.3k
Star
75k
Code
Issues
5k+
Pull requests
2.6k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Commits
Breadcrumbs
History for
cpython
Lib
random.py
on
3.14
User selector
All users
Datepicker
All time
Commit history
Commits on Jul 19, 2026
[3.14] gh-154001: Avoid division by zero in binomialvariate (GH-154004) (GH-154051)
Show description for 64bccca
miss-islington
and
lkk7
authored
64bccca
View commit details
Copy full SHA for 64bccca
View code at this point
Browse repository at this point
Commits on May 2, 2026
[3.14] gh-149221: Sync random.py with main branch (#149288)
Show description for 494989d
JelleZijlstra
authored
494989d
View commit details
Copy full SHA for 494989d
View code at this point
Browse repository at this point
[3.14]gh-149221:Fix binomialvariate Function for random module (gh-149276)
lighting9999
authored
a6d7bf5
View commit details
Copy full SHA for a6d7bf5
View code at this point
Browse repository at this point
Commits on May 5, 2025
gh-130645: Add color to stdlib argparse CLIs (gh-133380)
hugovk
authored
4ac916a
View commit details
Copy full SHA for 4ac916a
View code at this point
Browse repository at this point
Commits on Mar 20, 2025
gh-131269: Minor optimization in random.py (#131270)
colesbury
authored
844765b
View commit details
Copy full SHA for 844765b
View code at this point
Browse repository at this point
gh-131435: random.randint optimization (gh-131436)
dg-pb
authored
c83efa7
View commit details
Copy full SHA for c83efa7
View code at this point
Browse repository at this point
Commits on Mar 12, 2025
Improve docstring for random.binomialvariate (gh-131164)
Show description for 25f24b0
rhettinger
authored
25f24b0
View commit details
Copy full SHA for 25f24b0
View code at this point
Browse repository at this point
Commits on Feb 21, 2025
gh-130285: Fix handling of zero or empty counts in random.sample() (gh-130291)
rhettinger
authored
286c517
View commit details
Copy full SHA for 286c517
View code at this point
Browse repository at this point
Commits on Sep 12, 2024
gh-123968: Fix lower bound for `python -m random --float` (#123971)
andersk
authored
a362c41
View commit details
Copy full SHA for a362c41
View code at this point
Browse repository at this point
Commits on Jul 19, 2024
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907)
serhiy-storchaka
authored
1a0c7b9
View commit details
Copy full SHA for 1a0c7b9
View code at this point
Browse repository at this point
Commits on May 5, 2024
gh-118131: Command-line interface for the `random` module (#118132)
hugovk
authored
3b32575
View commit details
Copy full SHA for 3b32575
View code at this point
Browse repository at this point
Commits on Nov 9, 2023
gh-111881: Import _sha2 lazily in random (#111889)
Show description for b9f814c
vstinner
authored
b9f814c
View commit details
Copy full SHA for b9f814c
View code at this point
Browse repository at this point
Commits on Oct 10, 2023
gh-110050: Adjust the newline position in the TypeError message of the random.seed call. (#110051)
Show description for ce43d5f
yilei
and
rhettinger
authored
ce43d5f
View commit details
Copy full SHA for ce43d5f
View code at this point
Browse repository at this point
Commits on Oct 2, 2023
gh-109653: Reduce the import time of `random` by 60% (#110221)
AlexWaygood
authored
21a6263
View commit details
Copy full SHA for 21a6263
View code at this point
Browse repository at this point
Commits on Sep 26, 2023
More informative docstrings in the random module (gh-109745)
rhettinger
authored
19bf398
View commit details
Copy full SHA for 19bf398
View code at this point
Browse repository at this point
Commits on Sep 9, 2023
Fix an ironic typo in a code comment. (gh-109186)
rhettinger
authored
75cd865
View commit details
Copy full SHA for 75cd865
View code at this point
Browse repository at this point
Commits on Mar 23, 2023
Move binomialvariate() to a section for discrete distributions (GH-102955)
rhettinger
authored
4695709
View commit details
Copy full SHA for 4695709
View code at this point
Browse repository at this point
Commits on Jan 22, 2023
GH-101097: Switch from standard interval notation to greater or less than signs for random.random()'s documentation (#101119)
andrewhong04
authored
8bcd4a6
View commit details
Copy full SHA for 8bcd4a6
View code at this point
Browse repository at this point
Commits on Jan 8, 2023
GH-100805: Support numpy.array() in random.choice(). (GH-100830)
rhettinger
authored
9a68ff1
View commit details
Copy full SHA for 9a68ff1
View code at this point
Browse repository at this point
Commits on Dec 15, 2022
GH-100234: Set a default value for random.expovariate() (GH-100235)
rhettinger
authored
b430399
View commit details
Copy full SHA for b430399
View code at this point
Browse repository at this point
Commits on Aug 8, 2022
bpo-37000: Remove obsolete comment in _randbelow_with_getrandbits (#95775)
matthiasgoergens
authored
8a55e2f
View commit details
Copy full SHA for 8a55e2f
View code at this point
Browse repository at this point
Commits on Jul 24, 2022
log2() is faster than log() (#95214)
rhettinger
authored
eb9c8a8
View commit details
Copy full SHA for eb9c8a8
View code at this point
Browse repository at this point
Commits on Jul 23, 2022
Compute v only when needed. (#95183)
rhettinger
authored
a2fbc51
View commit details
Copy full SHA for a2fbc51
View code at this point
Browse repository at this point
Commits on Jul 13, 2022
GH-81620: Add random.binomialvariate() (GH-94719)
rhettinger
authored
ed06ec1
View commit details
Copy full SHA for ed06ec1
View code at this point
Browse repository at this point
Commits on Jun 22, 2022
gh-84623: Remove unused imports (#94132)
vstinner
authored
47e3562
View commit details
Copy full SHA for 47e3562
View code at this point
Browse repository at this point
Commits on May 12, 2022
gh-86388 Remove deprecated behaviors in randrange() (#92677)
rhettinger
authored
68fec31
View commit details
Copy full SHA for 68fec31
View code at this point
Browse repository at this point
Commits on Feb 15, 2022
bpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360)
ZackerySpytz
authored
08ec801
View commit details
Copy full SHA for 08ec801
View code at this point
Browse repository at this point
Commits on Feb 3, 2022
bpo-46624: Defer to 3.12: "Remove deprecated support for non-integer values" (GH-31098)
hroncok
authored
6baa98e
View commit details
Copy full SHA for 6baa98e
View code at this point
Browse repository at this point
Commits on Dec 10, 2021
Move error test to the function that needs it. Improve error message. (GH-30008)
rhettinger
authored
3fee777
View commit details
Copy full SHA for 3fee777
View code at this point
Browse repository at this point
Commits on Oct 16, 2021
bpo-42222: Remove deprecated support for non-integer values (GH-28983)
rhettinger
authored
5afa0a4
View commit details
Copy full SHA for 5afa0a4
View code at this point
Browse repository at this point
Commits on Sep 20, 2021
bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465)
rhettinger
authored
9510e6f
View commit details
Copy full SHA for 9510e6f
View code at this point
Browse repository at this point
Commits on May 4, 2021
bpo-40465: Remove random module features deprecated in 3.9 (GH-25874)
rhettinger
authored
70a071d
View commit details
Copy full SHA for 70a071d
View code at this point
Browse repository at this point
Commits on May 3, 2021
bpo-44018: random.seed() no longer mutates its inputs (GH-25856)
rhettinger
authored
b05352e
View commit details
Copy full SHA for b05352e
View code at this point
Browse repository at this point
Commits on Apr 20, 2021
Improve the error message for choices(population, 10) (GH-25267)
rhettinger
authored
2a36b09
View commit details
Copy full SHA for 2a36b09
View code at this point
Browse repository at this point
Commits on Feb 5, 2021
Reduce overhead on random timings (GH-24455)
rhettinger
authored
d9dda32
View commit details
Copy full SHA for d9dda32
View code at this point
Browse repository at this point
Previous
Next
You can’t perform that action at this time.