[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(). --

[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

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

2011-06-25 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11163 ___

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

2011-06-25 Thread Michael Grazebrook
Michael Grazebrook mich...@grazebrook.com added the comment: Thank you. On 25/06/2011 13:38, Raymond Hettinger wrote: Changes by Raymond Hettingerraymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python

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

2011-05-05 Thread Bryce Verdier
Bryce Verdier bryceverd...@gmail.com 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

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

2011-05-05 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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

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

2011-05-05 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11163 ___

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

2011-05-05 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11163 ___

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

2011-05-05 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com 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 rep...@bugs.python.org

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

2011-02-09 Thread Michael Grazebrook
New submission from Michael Grazebrook mich...@grazebrook.com: 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):

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

2011-02-09 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11163 ___ ___ Python-bugs-list