Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be7ff9f

Browse files
committed
Issue #20423: fix documentation of io.StringIO's newline parameter
1 parent 92af06b commit be7ff9f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/library/io.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,13 +844,14 @@ Text I/O
844844
Whether line buffering is enabled.
845845

846846

847-
.. class:: StringIO(initial_value='', newline=None)
847+
.. class:: StringIO(initial_value='', newline='\\n')
848848

849849
An in-memory stream for text I/O.
850850

851851
The initial value of the buffer (an empty string by default) can be set by
852852
providing *initial_value*. The *newline* argument works like that of
853-
:class:`TextIOWrapper`. The default is to do no newline translation.
853+
:class:`TextIOWrapper`. The default is to consider only ``\n`` characters
854+
as end of lines and to do no newline translation.
854855

855856
:class:`StringIO` provides this method in addition to those from
856857
:class:`TextIOBase` and its parents:

0 commit comments

Comments
 (0)