Skip to content

Commit cf2f244

Browse files
committed
fix example usage position
1 parent 91038e2 commit cf2f244

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/library/io.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,13 +1065,6 @@ Text I/O
10651065
.. versionchanged:: 3.11
10661066
The method supports ``encoding="locale"`` option.
10671067

1068-
Example usage::
1069-
1070-
# decoding newlines in universal newlines mode
1071-
>>> import io
1072-
>>> io.TextIOWrapper(io.BytesIO(b'1\r\n2\r3\n4')).read()
1073-
'1\n2\n3\n4'
1074-
10751068
.. method:: seek(cookie, whence=os.SEEK_SET, /)
10761069

10771070
Set the stream position.
@@ -1099,6 +1092,13 @@ Text I/O
10991092
The return value of :meth:`!tell` can be given as input to :meth:`seek`,
11001093
to restore a previous stream position.
11011094

1095+
Example usage::
1096+
1097+
# decoding newlines in universal newlines mode
1098+
>>> import io
1099+
>>> io.TextIOWrapper(io.BytesIO(b'1\r\n2\r3\n4')).read()
1100+
'1\n2\n3\n4'
1101+
11021102

11031103
.. class:: StringIO(initial_value='', newline='\n')
11041104

0 commit comments

Comments
 (0)