http://codereview.appspot.com/154060/diff/1/3 File Lib/test/test_range.py (right): http://codereview.appspot.com/154060/diff/1/3#newcode16 Lib/test/test_range.py:16: It might make sense to check for some minimum ...
http://codereview.appspot.com/154060/diff/1/3
File Lib/test/test_range.py (right):
http://codereview.appspot.com/154060/diff/1/3#newcode16
Lib/test/test_range.py:16:
It might make sense to check for some minimum number of items here, instead of
just non-empty. My concern is that if an error leaves an iterator with just one
entry, when you know that it should have millions. I realize you can't iterate
over all of the items for some of these tests, but maybe you could make this
assert_iterate_contains_at_least_n_items(self, iter, min_count, msg). (Pick
better names!)
Then, make sure the iterators have at least 1000 items or so.
14 years, 12 months ago
(2009-11-14 12:37:05 UTC)
#2
On 2009/11/11 20:35:52, eric2 wrote:
> http://codereview.appspot.com/154060/diff/1/3
> File Lib/test/test_range.py (right):
>
> http://codereview.appspot.com/154060/diff/1/3#newcode16
> Lib/test/test_range.py:16:
> It might make sense to check for some minimum number of items here, instead of
> just non-empty. My concern is that if an error leaves an iterator with just
one
> entry, when you know that it should have millions. I realize you can't iterate
> over all of the items for some of these tests, but maybe you could make this
> assert_iterate_contains_at_least_n_items(self, iter, min_count, msg). (Pick
> better names!)
>
> Then, make sure the iterators have at least 1000 items or so.
Thanks. I've updated the tests to check the items against a pure Python version
of range and reversed(range), up to the first 100 items.
http://codereview.appspot.com/154060/diff/1/3 File Lib/test/test_range.py (right): http://codereview.appspot.com/154060/diff/1/3#newcode16 Lib/test/test_range.py:16: On 2009/11/11 20:35:52, eric2 wrote: > It might make ...
14 years, 12 months ago
(2009-11-14 12:41:23 UTC)
#3
http://codereview.appspot.com/154060/diff/1/3
File Lib/test/test_range.py (right):
http://codereview.appspot.com/154060/diff/1/3#newcode16
Lib/test/test_range.py:16:
On 2009/11/11 20:35:52, eric2 wrote:
> It might make sense to check for some minimum number of items here, instead of
> just non-empty. My concern is that if an error leaves an iterator with just
one
> entry, when you know that it should have millions. I realize you can't iterate
> over all of the items for some of these tests, but maybe you could make this
> assert_iterate_contains_at_least_n_items(self, iter, min_count, msg). (Pick
> better names!)
>
> Then, make sure the iterators have at least 1000 items or so.
Done.
http://codereview.appspot.com/154060/diff/1/2
File Objects/rangeobject.c (right):
http://codereview.appspot.com/154060/diff/1/2#newcode492
Objects/rangeobject.c:492: * required. Return a value < 0 if & only if the true
value is too
This last sentence of the comment is no longer valid and should be deleted.
Issue 154060: [Issue 7298] Fix Python 3 range issues.
(Closed)
Created 15 years ago by dickinsm
Modified 14 years, 7 months ago
Reviewers: eric2
Base URL: http://svn.python.org/view/*checkout*/python/branches/py3k/
Comments: 5