@@ -1029,7 +1029,7 @@ PEP 3116: New I/O Library
1029
1029
1030
1030
Python's built-in file objects support a number of methods, but
1031
1031
file-like objects don't necessarily support all of them. Objects that
1032
- imitate files usually support :meth: `read ` and :meth: `write `, but they
1032
+ imitate files usually support :meth: `~io.TextIOBase. read ` and :meth: `~io.TextIOBase. write `, but they
1033
1033
may not support :meth: `readline `, for example. Python 3.0 introduces
1034
1034
a layered I/O library in the :mod: `io ` module that separates buffering
1035
1035
and text-handling features from the fundamental read and write
@@ -1038,47 +1038,47 @@ operations.
1038
1038
There are three levels of abstract base classes provided by
1039
1039
the :mod: `io ` module:
1040
1040
1041
- * :class: `RawIOBase ` defines raw I/O operations: :meth: `read `,
1042
- :meth: `readinto `,
1043
- :meth: `write `, :meth: `seek `, :meth: `tell `, :meth: `truncate `,
1044
- and :meth: `close `.
1041
+ * :class: `~io. RawIOBase ` defines raw I/O operations: :meth: `~io.RawIOBase. read `,
1042
+ :meth: `~io.RawIOBase. readinto `,
1043
+ :meth: `~io.RawIOBase. write `, :meth: `~io.IOBase. seek `, :meth: `~io.IOBase. tell `, :meth: `~io.IOBase. truncate `,
1044
+ and :meth: `~io.IOBase. close `.
1045
1045
Most of the methods of this class will often map to a single system call.
1046
- There are also :meth: `readable `, :meth: `writable `, and :meth: `seekable `
1046
+ There are also :meth: `~io.IOBase. readable `, :meth: `~io.IOBase. writable `, and :meth: `~io.IOBase. seekable `
1047
1047
methods for determining what operations a given object will allow.
1048
1048
1049
1049
Python 3.0 has concrete implementations of this class for files and
1050
1050
sockets, but Python 2.6 hasn't restructured its file and socket objects
1051
1051
in this way.
1052
1052
1053
- * :class: `BufferedIOBase ` is an abstract base class that
1053
+ * :class: `~io. BufferedIOBase ` is an abstract base class that
1054
1054
buffers data in memory to reduce the number of
1055
1055
system calls used, making I/O processing more efficient.
1056
- It supports all of the methods of :class: `RawIOBase `,
1057
- and adds a :attr: `raw ` attribute holding the underlying raw object.
1056
+ It supports all of the methods of :class: `~io. RawIOBase `,
1057
+ and adds a :attr: `~io.BufferedIOBase. raw ` attribute holding the underlying raw object.
1058
1058
1059
1059
There are five concrete classes implementing this ABC.
1060
- :class: `BufferedWriter ` and :class: `BufferedReader ` are for objects
1061
- that support write-only or read-only usage that have a :meth: `seek `
1062
- method for random access. :class: `BufferedRandom ` objects support
1060
+ :class: `~io. BufferedWriter ` and :class: `~io. BufferedReader ` are for objects
1061
+ that support write-only or read-only usage that have a :meth: `~io.IOBase. seek `
1062
+ method for random access. :class: `~io. BufferedRandom ` objects support
1063
1063
read and write access upon the same underlying stream, and
1064
- :class: `BufferedRWPair ` is for objects such as TTYs that have both
1064
+ :class: `~io. BufferedRWPair ` is for objects such as TTYs that have both
1065
1065
read and write operations acting upon unconnected streams of data.
1066
- The :class: `BytesIO ` class supports reading, writing, and seeking
1066
+ The :class: `~io. BytesIO ` class supports reading, writing, and seeking
1067
1067
over an in-memory buffer.
1068
1068
1069
1069
.. index ::
1070
1070
single: universal newlines; What's new
1071
1071
1072
- * :class: `TextIOBase `: Provides functions for reading and writing
1072
+ * :class: `~io. TextIOBase `: Provides functions for reading and writing
1073
1073
strings (remember, strings will be Unicode in Python 3.0),
1074
- and supporting :term: `universal newlines `. :class: `TextIOBase ` defines
1074
+ and supporting :term: `universal newlines `. :class: `~io. TextIOBase ` defines
1075
1075
the :meth: `readline ` method and supports iteration upon
1076
1076
objects.
1077
1077
1078
- There are two concrete implementations. :class: `TextIOWrapper `
1078
+ There are two concrete implementations. :class: `~io. TextIOWrapper `
1079
1079
wraps a buffered I/O object, supporting all of the methods for
1080
- text I/O and adding a :attr: `buffer ` attribute for access
1081
- to the underlying object. :class: `StringIO ` simply buffers
1080
+ text I/O and adding a :attr: `~io.TextIOBase. buffer ` attribute for access
1081
+ to the underlying object. :class: `~io. StringIO ` simply buffers
1082
1082
everything in memory without ever writing anything to disk.
1083
1083
1084
1084
(In Python 2.6, :class: `io.StringIO ` is implemented in
0 commit comments