Repository navigation
python -m random --float N should pick a float between 0 and N, not 1 and N #123968
Copy link
Copy link
Closed
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Sep 11, 2024 - added a commit that references this issue
on Sep 11, 2024 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Sep 11, 2024 - added a commit that references this issue
on Sep 11, 2024 To avoid compatibility issues, it would be good to fix this in 3.13.0 so I added release-blocker. Please let me know if that's inappropriate
Reacted by Kirill Podoprigora and Hugo van Kemenade- added a commit that references this issue
on Sep 23, 2024 Merged and backported, thanks!
- moved this from Todo to Done in Release and Deferred blockers 🚫
on Sep 23, 2024 - added a commit that references this issue
on Sep 26, 2024
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
In the specification for the new
python -m randomCLI for 3.13 (#118131), the proposed behavior wasHowever, what was actually implemented (#118132, cc @hugovk) was
This is surprising and not helpful. Everyone will expect a range of length
Nstarting from0.0, not a range of lengthN - 1.0starting from1.0.(Note that this is completely distinct from the debate about whether it’s more natural to select integers from
[1, …, N]or[0, …, N - 1], as at least those are both ranges of lengthN.)CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
python -m random --float#123971python -m random --float(GH-123971) #124009