Scanning a file

Peter Otten __peter__ at web.de
Sat Oct 29 14:36:12 EDT 2005


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.

Peter




More information about the Python-list mailing list