Message62950
Attached patch addresses OP's issue:
$ ./python.exe bad_range.py
[8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
here
[18446744073709551616L, 18446744073709551617L, 18446744073709551618L,
18446744073709551619L, 18446744073709551620L, 18446744073709551621L,
18446744073709551622L, 18446744073709551623L, 18446744073709551624L,
18446744073709551625L]
[18446744073709551616L, 18446744073709551617L, 18446744073709551618L,
18446744073709551619L, 18446744073709551620L, 18446744073709551621L,
18446744073709551622L, 18446744073709551623L, 18446744073709551624L,
18446744073709551625L]
The only existing test that fails is range(1e100, 1e101, 1e101)
producing a TypeError. It will now produce
>>> range(1e100, 1e101, 1e101)
__main__:1: DeprecationWarning: integer argument expected, got float
[10000000000000000159028911097599180468360808563945281389781327557747838
772170381060813469985856815104L]
Note that range(1e100, 1e101) would still fail:
>>> range(1e100, 1e101)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: range() result has too many items
An alternative solution would be to disallow non-ints regardless of
their value, but that is more likely to break someone's code. |
|
| Date |
User |
Action |
Args |
| 2008-02-24 23:08:47 | belopolsky | set | spambayes_score: 0.0378196 -> 0.0378196 recipients:
+ belopolsky, rhettinger, christian.heimes, josm, robertwb, zanella |
| 2008-02-24 23:08:46 | belopolsky | set | spambayes_score: 0.0378196 -> 0.0378196 messageid: <1203894526.82.0.0976533527868.issue1533@psf.upfronthosting.co.za> |
| 2008-02-24 23:08:45 | belopolsky | link | issue1533 messages |
| 2008-02-24 23:08:45 | belopolsky | create | |
|