-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Doc: Fix random.uniform example comment. #25784
Conversation
Note, the example isn't using two different values.
Also, I think the docs should be left as-is. The intention was to create a half-open interval. In a small way, this make the docs slightly worse. Are you responding to a reported user problem? |
That's right, nice catch. I'm trying to find an example: from collections import Counter
import math
from random import uniform
start = 0
while True:
stop = math.nextafter(start, math.inf)
assert start != stop
values = Counter([uniform(start, stop) for _ in range(100)])
assert len(values) == 2
assert start in values
assert stop in values
start = stop I cannot find an example where the end is not included using the code above, do you have an example where the end is excluded?
Yes from docs@. |
Thanks @JulienPalard for the PR, and @rhettinger for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-25843 is a backport of this pull request to the 3.9 branch. |
(cherry picked from commit 440c025) Co-authored-by: Julien Palard <[email protected]>
(cherry picked from commit 440c025) Co-authored-by: Julien Palard <[email protected]> Automerge-Triggered-By: GH:JulienPalard
Checked using: