[issue34764] Improve documentation example for using iter() with sentinel value

2018-12-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 00a48d57dfd52a968b357d68f63c51db3a451566 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-34764: improve docs example of iter() with sentinel value (GH-11222) (#11301)

[issue34764] Improve documentation example for using iter() with sentinel value

2018-12-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +10536 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34764] Improve documentation example for using iter() with sentinel value

2018-12-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset d378b1f8ed7919f65a89f026bc899204be3773d4 by Raymond Hettinger (Chris Rands) in branch 'master': bpo-34764: improve docs example of iter() with sentinel value (GH-11222)

[issue34764] Improve documentation example for using iter() with sentinel value

2018-12-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34764] Improve documentation example for using iter() with sentinel value

2018-12-18 Thread ChrisRands
Change by ChrisRands : -- keywords: +patch pull_requests: +10457 stage: -> patch review ___ Python tracker ___ ___

[issue34764] Improve documentation example for using iter() with sentinel value

2018-09-21 Thread ChrisRands
ChrisRands added the comment: Thank you Raymond, I like both your examples, although I think I prefer 1) for the simplicity -- ___ Python tracker ___

[issue34764] Improve documentation example for using iter() with sentinel value

2018-09-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur that the readline() example is problematic. While it succeeds in showing how iter() works, the example itself is not the best way to solve that particular problem. Here are two possible substitute examples. 1) Simple example that focuses

[issue34764] Improve documentation example for using iter() with sentinel value

2018-09-21 Thread ChrisRands
New submission from ChrisRands : This arose from this SO question: https://stackoverflow.com/questions/52446415/line-in-iterfp-readline-rather-than-line-in-fp The example given in the docs: with open('mydata.txt') as fp: for line in iter(fp.readline, ''): process_line(line) Is