summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-11-15 16:38:06 (GMT)
committerFred Drake <fdrake@acm.org>2002-11-15 16:38:06 (GMT)
commit3a2cda876b58249d7f8444f5a2844100205299ee (patch)
tree0c67313a3bedc8e926a9a454525441d41e5bf69b /Doc/lib
parente0373f81791869197d4506c20c9e11916b8fa37a (diff)
downloadcpython-3a2cda876b58249d7f8444f5a2844100205299ee.zip
cpython-3a2cda876b58249d7f8444f5a2844100205299ee.tar.gz
cpython-3a2cda876b58249d7f8444f5a2844100205299ee.tar.bz2
Minor revisions to clarify the status of xreadlines(), change the way
iteration support was documented; the docs for __iter__() were just confusing.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libbz2.tex29
1 files changed, 14 insertions, 15 deletions
diff --git a/Doc/lib/libbz2.tex b/Doc/lib/libbz2.tex
index 9a4423b..ea6f3ec 100644
--- a/Doc/lib/libbz2.tex
+++ b/Doc/lib/libbz2.tex
@@ -17,7 +17,7 @@ Here is a resume of the features offered by the bz2 module:
\begin{itemize}
\item \class{BZ2File} class implements a complete file interface, including
- \method{readline()}, \method{readlines()}, \method{xreadlines()},
+ \method{readline()}, \method{readlines()},
\method{writelines()}, \method{seek()}, etc;
\item \class{BZ2File} class implements emulated \method{seek()} support;
\item \class{BZ2File} class implements universal newline support;
@@ -47,14 +47,15 @@ it doesn't exist, and truncated otherwise. If \var{buffering} is given,
the default is \code{0}. If
\var{compresslevel} is given, must be a number between \code{1} and
\code{9}; the default is \code{9}.
-Add a \code{'U'} to mode to open the file for input with universal newline
+Add a \character{U} to mode to open the file for input with universal newline
support. Any line ending in the input file will be seen as a
-\character{\textbackslash n}
-in Python. Also, a file so opened gains the attribute \member{newlines};
-the value for this attribute is one of \code{None} (no newline read yet),
-\code{'\textbackslash r'}, \code{'\textbackslash n'},
-\code{'\textbackslash r\textbackslash n'} or a tuple containing all the
-newline types seen. Universal newlines are available only when reading.
+\character{\e n} in Python. Also, a file so opened gains the
+attribute \member{newlines}; the value for this attribute is one of
+\code{None} (no newline read yet), \code{'\e r'}, \code{'\e n'},
+\code{'\e r\e n'} or a tuple containing all the newline types
+seen. Universal newlines are available only when reading.
+Instances support iteration in the same way as normal \class{file}
+instances.
\end{classdesc}
\begin{methoddesc}[BZ2File]{close}{}
@@ -82,13 +83,11 @@ is an approximate bound on the total number of bytes in the lines returned.
\begin{methoddesc}[BZ2File]{xreadlines}{}
For backward compatibility. \class{BZ2File} objects now include the
-performance optimizations previously implemented in the \module{xreadlines}
-module.
-\end{methoddesc}
-
-\begin{methoddesc}[BZ2File]{\_\_iter\_\_}{}
-Iterate through the file lines. Iteration optimization is implemented
-using the same readahead algorithm available in \class{file} objects.
+performance optimizations previously implemented in the
+\refmodule{xreadlines} module.
+\deprecated{2.3}{This exists only for compatibility with the method by
+ this name on \class{file} objects, which is
+ deprecated. Use \code{for line in file} instead.}
\end{methoddesc}
\begin{methoddesc}[BZ2File]{seek}{offset\optional{, whence}}