Scanning a file

Steve Holden steve at holdenweb.com
Sat Oct 29 16:10:11 EDT 2005


Peter Otten wrote:
> Bengt Richter wrote:
> 
> 
>>What struck me was
>>
>>
>>>>> gen = byblocks(StringIO.StringIO('no'),1024,len('end?')-1)
>>>>> [gen.next() for i in xrange(10)]
>>
>>['no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no']
> 
> 
> Ouch. Seems like I spotted the subtle cornercase error and missed the big
> one.
> 

No, you just realised subconsciously that we'd all spot the obvious one 
and decided to point out the bug that would remain after the obvious one 
had been fixed.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list