8000 make example binary; fix indentation · python/cpython@b01f506 · GitHub
[go: up one dir, main page]

Skip to content

Commit b01f506

Browse files
committed
make example binary; fix indentation
1 parent 747ee53 commit b01f506

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/library/functions.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,13 @@ are always available. They are listed here in alphabetical order.
811811
See also :ref:`typeiter`.
812812

813813
One useful application of the second form of :func:`iter` is to build a
814-
block-reader. For example, reading fixed-width blocks from a text file
815-
until the end of file is reached:
814+
block-reader. For example, reading fixed-width blocks from a binary
815+
database file until the end of file is reached::
816816

817-
from functools import partial
818-
with open('mydata.txt') as fp:
819-
for block in iter(partial(fp.read, 64), ''):
820-
process_block(block)
817+
from functools import partial
818+
with open('mydata.db', 'rb') as f:
819+
for block in iter(partial(f.read, 64), ''):
820+
process_block(block)
821821

822822

823823
.. function:: len(s)

0 commit comments

Comments
 (0)
0