[issue11163] iter() documentation code doesn't work

2011-06-25 Thread Michael Grazebrook
Michael Grazebrook added the comment: Thank you. On 25/06/2011 13:38, Raymond Hettinger wrote: > Changes by Raymond Hettinger: > > > -- > resolution: -> fixed > status: open -> closed > > ___ > Python tracker >

[issue11163] iter() documentation code doesn't work

2011-02-09 Thread Michael Grazebrook
New submission from Michael Grazebrook : This code fragment from the documentation of iter() doesn't work as intended. Change "STOP" to "STOP\n". Maybe also check for EOF as it hangs. with open("mydata.txt") as fp: for line in iter(fp.readline, "STOP