fix example usage position

This commit is contained in:
guoci 2025-10-31 11:31:15 -04:00
parent 91038e2676
commit cf2f24493b

View file

@ -1065,13 +1065,6 @@ Text I/O
.. versionchanged:: 3.11
The method supports ``encoding="locale"`` option.
Example usage::
# decoding newlines in universal newlines mode
>>> import io
>>> io.TextIOWrapper(io.BytesIO(b'1\r\n2\r3\n4')).read()
'1\n2\n3\n4'
.. method:: seek(cookie, whence=os.SEEK_SET, /)
Set the stream position.
@ -1099,6 +1092,13 @@ Text I/O
The return value of :meth:`!tell` can be given as input to :meth:`seek`,
to restore a previous stream position.
Example usage::
# decoding newlines in universal newlines mode
>>> import io
>>> io.TextIOWrapper(io.BytesIO(b'1\r\n2\r3\n4')).read()
'1\n2\n3\n4'
.. class:: StringIO(initial_value='', newline='\n')