@@ -768,16 +768,20 @@ Text I/O
768768 sequences) can be used. Any other error handling name that has been
769769 registered with :func: `codecs.register_error ` is also valid.
770770
771+ .. index ::
772+ single: universal newlines; io.TextIOWrapper class
773+
771774 *newline * controls how line endings are handled. It can be ``None ``,
772775 ``'' ``, ``'\n' ``, ``'\r' ``, and ``'\r\n' ``. It works as follows:
773776
774- * When reading input from the stream, if *newline * is ``None ``, universal
775- newlines mode is enabled. Lines in the input can end in ``'\n' ``,
776- ``'\r' ``, or ``'\r\n' ``, and these are translated into ``'\n' `` before
777- being returned to the caller. If it is ``'' ``, universal newline mode is
778- enabled, but line endings are returned to the caller untranslated. If it
779- has any of the other legal values, input lines are only terminated by the
780- given string, and the line ending is returned to the caller untranslated.
777+ * When reading input from the stream, if *newline * is ``None ``,
778+ :term: `universal newlines ` mode is enabled. Lines in the input can end in
779+ ``'\n' ``, ``'\r' ``, or ``'\r\n' ``, and these are translated into ``'\n' ``
780+ before being returned to the caller. If it is ``'' ``, universal newlines
781+ mode is enabled, but line endings are returned to the caller untranslated.
782+ If it has any of the other legal values, input lines are only terminated
783+ by the given string, and the line ending is returned to the caller
784+ untranslated.
781785
782786 * When writing output to the stream, if *newline * is ``None ``, any ``'\n' ``
783787 characters written are translated to the system default line separator,
@@ -843,10 +847,13 @@ Text I/O
843847 output.close()
844848
845849
850+ .. index ::
851+ single: universal newlines; io.IncrementalNewlineDecoder class
852+
846853.. class :: IncrementalNewlineDecoder
847854
848- A helper codec that decodes newlines for universal newlines mode. It
849- inherits :class: `codecs.IncrementalDecoder `.
855+ A helper codec that decodes newlines for :term: ` universal newlines ` mode.
856+ It inherits :class: `codecs.IncrementalDecoder `.
850857
851858
852859Performance
0 commit comments