From cf2f24493beed541a924cc37cb586f2fc4aa1c88 Mon Sep 17 00:00:00 2001 From: guoci Date: Fri, 31 Oct 2025 11:31:15 -0400 Subject: [PATCH] fix example usage position --- Doc/library/io.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index bc57e57ad47..beab6d16958 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -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')