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

2013-09-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: In the current 3.3.2 docs, 'STOP' has been replaced by '', so there is a change, and no infinite loop. However, this is still does not strike me as an example of 'useful' as for line in iter(fp.readline, "STOP"): # is a bad version of for line in fp: It do

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

2013-09-11 Thread purplezephyr
purplezephyr added the comment: This does not seem to have been changed in any version, per msg135246. If it's not going to be replaced, there's another issue, which is that the link to readline() in the text is incorrect - it goes to the readline module, not file.readline(). -- nosy

[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-06-25 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

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

2011-05-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll replace this with a better example using binary chunked reads that terminate with an empty string. -- priority: normal -> low ___ Python tracker _

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

2011-05-05 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

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

2011-05-05 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3 -Python 2.6 ___ Python tracker ___ ___ Python

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

2011-05-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think this is the wrong patch for reasons given below. The example should be replaced instead. Readline is documented as returning '' at EOF for text files. Iter(func,sentinel) is documented as calling func until sentinel is returned. If that never happens,

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

2011-05-05 Thread Bryce Verdier
Bryce Verdier added the comment: Here is the patch to fix the documentation. Asked some core developers off the bug tracker how to handle this bug in relation to the bigger issue regarding "STOP" leading to an infinite loop. -- keywords: +patch nosy: +louiscipher Added file: http://bu

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

2011-02-09 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[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"): process_line(line) Or maybe