]> granicus.if.org Git - python/commitdiff
Get rid of xreadlines() (methods).
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 17 Mar 2006 08:29:44 +0000 (08:29 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 17 Mar 2006 08:29:44 +0000 (08:29 +0000)
Doc/lib/libbz2.tex
Doc/lib/libstdtypes.tex
Doc/tools/undoc_symbols.py
Lib/rexec.py
Lib/test/test_bz2.py
Lib/test/test_decimal.py
Lib/test/test_file.py
Misc/python.man
Modules/bz2module.c
Objects/fileobject.c
README

index f40b66f153934c56c2a0a7a4762d1b346941bce4..11801fe7e6fd8d73d508050f151316e25d1d1697 100644 (file)
@@ -79,15 +79,6 @@ Return a list of lines read. The optional \var{size} argument, if given,
 is an approximate bound on the total number of bytes in the lines returned.
 \end{methoddesc}
 
-\begin{methoddesc}[BZ2File]{xreadlines}{}
-For backward compatibility. \class{BZ2File} objects now include the
-performance optimizations previously implemented in the
-\module{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}}
 Move to new file position. Argument \var{offset} is a byte count. Optional
 argument \var{whence} defaults to \code{0} (offset from start of file,
index 5d153758b92d45607d2f9be780b4d46dd99d978f..d2a0425fb10564654265caf8b1d0bdee17fe27d6 100644 (file)
@@ -1583,12 +1583,6 @@ flush the read-ahead buffer.
   implemented, or cannot be implemented efficiently.
 \end{methoddesc}
 
-\begin{methoddesc}[file]{xreadlines}{}
-  This method returns the same thing as \code{iter(f)}.
-  \versionadded{2.1}
-  \deprecated{2.3}{Use \samp{for \var{line} in \var{file}} instead.}
-\end{methoddesc}
-
 \begin{methoddesc}[file]{seek}{offset\optional{, whence}}
   Set the file's current position, like \code{stdio}'s \cfunction{fseek()}.
   The \var{whence} argument is optional and defaults to \code{0}
index 3d776fa45a13511eb2ed516eb0628728fb7af443..782ab6ca939892460ab68f273a2821e8cddcba9a 100644 (file)
@@ -50,7 +50,7 @@ import os, glob, re, sys
 
 def findnames(file, prefixes=()):
     names = {}
-    for line in file.xreadlines():
+    for line in file:
         if line[0] == '!':
             continue
         fields = line.split()
index 89ff5097068b91ace9201432b81b554fabaee84a..ed01d242efc79bd2bdadca72a3278194ac0b785a 100644 (file)
@@ -29,7 +29,7 @@ __all__ = ["RExec"]
 class FileBase:
 
     ok_file_methods = ('fileno', 'flush', 'isatty', 'read', 'readline',
-            'readlines', 'seek', 'tell', 'write', 'writelines', 'xreadlines',
+            'readlines', 'seek', 'tell', 'write', 'writelines', 
             '__iter__')
 
 
index 504a6d771ed46f2f71e7651566760dcc0e02a977..356c2e33a7c0a16ac6e7a3d1dea24877a5d267ed 100644 (file)
@@ -110,14 +110,6 @@ class BZ2FileTest(BaseTest):
         self.assertEqual(list(iter(bz2f)), sio.readlines())
         bz2f.close()
 
-    def testXReadLines(self):
-        # "Test BZ2File.xreadlines()"
-        self.createTempFile()
-        bz2f = BZ2File(self.filename)
-        sio = StringIO(self.TEXT)
-        self.assertEqual(list(bz2f.xreadlines()), sio.readlines())
-        bz2f.close()
-
     def testUniversalNewlinesLF(self):
         # "Test BZ2File.read() with universal newlines (\\n)"
         self.createTempFile()
@@ -256,7 +248,7 @@ class BZ2FileTest(BaseTest):
         bz2f.close()
         self.assertEqual(lines, ['Test'])
         bz2f = BZ2File(self.filename)
-        xlines = list(bz2f.xreadlines())
+        xlines = list(bz2f.readlines())
         bz2f.close()
         self.assertEqual(lines, ['Test'])
 
index 34f034b850bc3c8262c945329c4a62168da1db46..7d0addf21772d6e08c2c2a5f2a9546fb2fc41f15 100644 (file)
@@ -132,7 +132,7 @@ class DecimalTest(unittest.TestCase):
         if skip_expected:
             raise TestSkipped
             return
-        for line in open(file).xreadlines():
+        for line in open(file):
             line = line.replace('\r\n', '').replace('\n', '')
             #print line
             try:
index efb06f44e4d2fdf43bba1d0c678b742295169592..fd5670adeaa1d38cb7c2cc4b91e0efdd6fafa0e3 100644 (file)
@@ -179,7 +179,7 @@ for s in (-1, 0, 1, 512):
 
 methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
            'readline', 'readlines', 'seek', 'tell', 'truncate', 'write',
-           'xreadlines', '__iter__']
+           '__iter__']
 if sys.platform.startswith('atheos'):
     methods.remove('truncate')
 
index 705f7bcbd4c544886cdec8883c87789e039d5be2..42f012343acf4eab6614c134aa5363c689a62846 100644 (file)
@@ -152,7 +152,7 @@ expressed in spaces.  Issue an error when the option is given twice.
 .B \-u
 Force stdin, stdout and stderr to be totally unbuffered.  On systems
 where it matters, also put stdin, stdout and stderr in binary mode.
-Note that there is internal buffering in xreadlines(), readlines() and
+Note that there is internal buffering in readlines() and
 file-object iterators ("for line in sys.stdin") which is not
 influenced by this option.  To work around this, you will want to use
 "sys.stdin.readline()" inside a "while 1:" loop.
index ed329b8a0f016b61de154e69e7f84a61774d8117..957689596d5433d98414a99e6e9c6a0d94dcef0b 100644 (file)
@@ -778,13 +778,6 @@ BZ2File_readlines(BZ2FileObject *self, PyObject *args)
        return list;
 }
 
-PyDoc_STRVAR(BZ2File_xreadlines__doc__,
-"xreadlines() -> self\n\
-\n\
-For backward compatibility. BZ2File objects now include the performance\n\
-optimizations previously implemented in the xreadlines module.\n\
-");
-
 PyDoc_STRVAR(BZ2File_write__doc__,
 "write(data) -> None\n\
 \n\
@@ -1183,7 +1176,6 @@ static PyMethodDef BZ2File_methods[] = {
        {"read", (PyCFunction)BZ2File_read, METH_VARARGS, BZ2File_read__doc__},
        {"readline", (PyCFunction)BZ2File_readline, METH_VARARGS, BZ2File_readline__doc__},
        {"readlines", (PyCFunction)BZ2File_readlines, METH_VARARGS, BZ2File_readlines__doc__},
-       {"xreadlines", (PyCFunction)BZ2File_getiter, METH_VARARGS, BZ2File_xreadlines__doc__},
        {"write", (PyCFunction)BZ2File_write, METH_VARARGS, BZ2File_write__doc__},
        {"writelines", (PyCFunction)BZ2File_writelines, METH_O, BZ2File_writelines__doc__},
        {"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__},
index 57a9e9d39bb2da16859d9604e53852662c490308..f96ee7b6111f94fdef2845c5e8de57a4a69d2f74 100644 (file)
@@ -1675,12 +1675,6 @@ PyDoc_STRVAR(readlines_doc,
 "The optional size argument, if given, is an approximate bound on the\n"
 "total number of bytes in the lines returned.");
 
-PyDoc_STRVAR(xreadlines_doc,
-"xreadlines() -> returns self.\n"
-"\n"
-"For backward compatibility. File objects now include the performance\n"
-"optimizations previously implemented in the xreadlines module.");
-
 PyDoc_STRVAR(writelines_doc,
 "writelines(sequence_of_strings) -> None.  Write the strings to the file.\n"
 "\n"
@@ -1719,7 +1713,6 @@ static PyMethodDef file_methods[] = {
        {"tell",      (PyCFunction)file_tell,     METH_NOARGS,  tell_doc},
        {"readinto",  (PyCFunction)file_readinto, METH_VARARGS, readinto_doc},
        {"readlines", (PyCFunction)file_readlines,METH_VARARGS, readlines_doc},
-       {"xreadlines",(PyCFunction)file_self,     METH_NOARGS, xreadlines_doc},
        {"writelines",(PyCFunction)file_writelines, METH_O,    writelines_doc},
        {"flush",     (PyCFunction)file_flush,    METH_NOARGS,  flush_doc},
        {"close",     (PyCFunction)file_close,    METH_NOARGS,  close_doc},
diff --git a/README b/README
index 70cb26d02c9fba75a3ed08dc00d05543353de917..919af4c4b8d2b35297a6ff788db276be285db1f3 100644 (file)
--- a/README
+++ b/README
@@ -504,9 +504,9 @@ Cray T3E: Mark Hadfield (m.hadfield@niwa.co.nz) writes:
 
             _codecs, _locale, _socket, _symtable, _testcapi, _weakref
             array, binascii, cmath, cPickle, crypt, cStringIO, dbm
-            errno, fcntl, grp, math, md5, operator, parser, pcre, pwd
-            regex, rotor, select, struct, strop, syslog, termios
-            time, timing, xreadlines
+            errno, fcntl, grp, math, md5, operator, parser, pwd
+            rotor, select, struct, strop, syslog, termios,
+            time, timing
 
        4) Once the python executable and library have been built, make
           will execute setup.py, which will attempt to build remaining