GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — `python -m random N` prints a float for an integer N <= 0 · Issue #161452 · python/cpython Open Labels stdlibStandard 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 DescriptionBug reportBug description:The command-line interface of $ python -m random -i 0
Traceback (most recent call last):
...
ValueError: empty range in randint(1, 0)
$ python -m random 0
0.0
$ python -m random -5
-2.8133945085995364
try: # Is it an integer? val = int(val) return randint(1, val) except ValueError: try: # Is it a float? val = float(val) return uniform(0, val) so the CPython versions tested on:3.14, 3.15, CPython main branch Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard 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 ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| 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. |