GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-123968: Fix lower bound for `python -m random --float` by andersk · Pull Request #123971 · python/cpython

Conversation

@andersk

@andersk andersk commented Sep 11, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

python -m random --float N incorrectly used a range between 1 and N of length N - 1. Fix it to use a range between 0 and N of length N, as originally specified in #118131, and as everyone will expect.

  • Issue: python -m random --float N should pick a float between 0 and N, not 1 and N #123968

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andersk
andersk requested a review from rhettinger as a code owner September 11, 2024 19:04
@bedevere-app bedevere-app Bot added the awaiting review label Sep 11, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Sep 11, 2024
python -m random --float N should pick a float between 0 and N, not 1 and N #123968
Closed
@andersk andersk mentioned this pull request Sep 11, 2024
gh-118131: Command-line interface for the random module #118132
Merged
@andersk
andersk force-pushed the random-float branch from f574fbf to 98fb826 Compare September 11, 2024 19:14
@andersk
pythongh-123968: Fix lower bound for python -m random --float
14e414a
`python -m random --float N` incorrectly used a range between 1 and N
of length N - 1.  Fix it to use a range between 0 and N of length N,
as originally specified in python#118131, and as everyone will expect.

Fixes python#123968.

Signed-off-by: Anders Kaseorg <[email protected]>
@andersk
andersk force-pushed the random-float branch from 98fb826 to 14e414a Compare September 11, 2024 19:43
@Eclips4
Eclips4 requested review from hugovk and removed request for rhettinger September 11, 2024 19:55
@Eclips4 Eclips4 added the needs backport to 3.13 only security fixes label Sep 12, 2024
@hugovk
hugovk merged commit a362c41 into python:main Sep 12, 2024
@miss-islington-app

miss-islington-app Bot commented Sep 12, 2024

Copy link
Copy Markdown

Thanks @andersk for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Sep 12, 2024
@hugovk

hugovk commented Sep 12, 2024

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2024
@andersk @miss-islington
pythongh-123968: Fix lower bound for python -m random --float (pyth…
d556d27
…onGH-123971)

(cherry picked from commit a362c41)

Co-authored-by: Anders Kaseorg <[email protected]>
@bedevere-app

bedevere-app Bot commented Sep 12, 2024

Copy link
Copy Markdown

GH-124009 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Sep 12, 2024
@andersk
andersk deleted the random-float branch September 16, 2024 21:44
Yhg1s pushed a commit that referenced this pull request Sep 23, 2024
@miss-islington @andersk
[3.13] gh-123968: Fix lower bound for python -m random --float (GH-…
7b8affa
…123971) (#124009)

gh-123968: Fix lower bound for `python -m random --float` (GH-123971)
(cherry picked from commit a362c41)

Co-authored-by: Anders Kaseorg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk Awaiting requested review from hugovk

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@andersk @hugovk @Eclips4
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.