8000 bpo-34764: improve docs example of iter() with sentinel value by chris-rands · Pull Request #11222 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-34764: improve docs example of iter() with sentinel value #11222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 24, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix indentation
  • Loading branch information
chris-rands committed Dec 23, 2018
commit 747ee530b4b4b1118a9fbed630599d723a7b12e3
8 changes: 4 additions & 4 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,10 @@ are always available. They are listed here in alphabetical order.
block-reader. For example, reading fixed-width blocks from a text file
until the end of file is reached:

from functools import partial
with open('mydata.txt') as fp:
for block in iter(partial(fp.read, 64), ''):
process_block(block)
from functools import partial
with open('mydata.txt') as fp:
for block in iter(partial(fp.read, 64), ''):
process_block(block)


.. function:: len(s)
Expand Down
0