From ceef65c8919a69db949a54273ac615a1f6a5b321 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 19 Mar 2021 07:28:31 +0900 Subject: [PATCH 1/2] Doc: io: Move In-memory streams section into overview section. --- Doc/library/io.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index aecbec56866d73..2f3df71d740996 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -106,6 +106,16 @@ stream by opening a file in binary mode with buffering disabled:: The raw stream API is described in detail in the docs of :class:`RawIOBase`. +In-memory streams +^^^^^^^^^^^^^^^^^ + +It is also possible to use a :class:`str` or :term:`bytes-like object` as a +file for both reading and writing. For strings :class:`StringIO` can be used +like a file opened in text mode. :class:`BytesIO` can be used like a file +opened in binary mode. Both provide full read-write capabilities with random +access. + + High-level Module Interface --------------------------- @@ -155,16 +165,6 @@ High-level Module Interface when an unsupported operation is called on a stream. -In-memory streams -^^^^^^^^^^^^^^^^^ - -It is also possible to use a :class:`str` or :term:`bytes-like object` as a -file for both reading and writing. For strings :class:`StringIO` can be used -like a file opened in text mode. :class:`BytesIO` can be used like a file -opened in binary mode. Both provide full read-write capabilities with random -access. - - .. seealso:: :mod:`sys` From 18505338a320ffe936b701ef1f6c06b51710f4b3 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 21 Mar 2021 10:09:41 +0900 Subject: [PATCH 2/2] remove In-memory streams section --- Doc/library/io.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 2f3df71d740996..96e02e839ae653 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -106,16 +106,6 @@ stream by opening a file in binary mode with buffering disabled:: The raw stream API is described in detail in the docs of :class:`RawIOBase`. -In-memory streams -^^^^^^^^^^^^^^^^^ - -It is also possible to use a :class:`str` or :term:`bytes-like object` as a -file for both reading and writing. For strings :class:`StringIO` can be used -like a file opened in text mode. :class:`BytesIO` can be used like a file -opened in binary mode. Both provide full read-write capabilities with random -access. - - High-level Module Interface ---------------------------