Message98320
I would like to submit the following test to be part of the test_iter.py test suite:
def test_extends(self):
# This test would break on an incomplete patch to listobject.c
def gen():
for i in range(500):
yield i
lst = [0] * 500
for i in range(240):
lst.pop(0)
lst.extend(gen())
The history behind it is that I made a patch to listobject.c that obviously broke listextend(), but the tests did not catch it. This was my failing test to improve my patch. Regardless of what happens to the patch, I think it's a good idea to hammer on listextend() when it accepts an iterator, as it's a fairly tricky problem to extend a list when you do not know in advance how long it will be until the iterator gets exhausted. |
|
Date |
User |
Action |
Args |
2010-01-26 08:12:06 | Steve Howell | set | recipients:
+ Steve Howell |
2010-01-26 08:12:06 | Steve Howell | set | messageid: <1264493526.37.0.587552008343.issue7782@psf.upfronthosting.co.za> |
2010-01-26 08:12:04 | Steve Howell | link | issue7782 messages |
2010-01-26 08:12:02 | Steve Howell | create | |
|