mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
fix example usage position
This commit is contained in:
parent
91038e2676
commit
cf2f24493b
1 changed files with 7 additions and 7 deletions
|
|
@ -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')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue