Message65330
Thanks for all of the help. Using range_item certainly simplified my
job. Although I more than made up for it with all of the decref and
error checking calls.
One side effect of using range_item is that str(range(...)) is now
subject to the same errors as indexing into really big range:
for example:
x = range(1000000000000000000)
x[1]
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C ssize_t
In a world where ints and long ints have been unified the existence of
this error seems like a bug.
I think the right thing would be to fix range_item and range_length so
they do not use Py_ssize_t for the length of the range. But I may be in
over my head on that guess.
I also discovered that range_item does not work with negative indices.
I have been poking around the tests and added some simple tests to the
test_range.py class as well. I assume I should submit a patch for that
as well?
I have attached a new patch for rangeobject.c
Brad |
|
| Date |
User |
Action |
Args |
| 2008-04-11 02:04:27 | bmiller | set | spambayes_score: 0.0379668 -> 0.0379668 recipients:
+ bmiller, loewis, benjamin.peterson |
| 2008-04-11 02:04:26 | bmiller | set | spambayes_score: 0.0379668 -> 0.0379668 messageid: <1207879466.62.0.9144401122.issue2610@psf.upfronthosting.co.za> |
| 2008-04-11 02:04:25 | bmiller | link | issue2610 messages |
| 2008-04-11 02:04:23 | bmiller | create | |
|