[Python-checkins] r43106 - in python/branches/p3yk: 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

neal.norwitz python-checkins at python.org
Fri Mar 17 09:29:50 CET 2006


Author: neal.norwitz
Date: Fri Mar 17 09:29:44 2006
New Revision: 43106
Modified:
 python/branches/p3yk/Doc/lib/libbz2.tex
 python/branches/p3yk/Doc/lib/libstdtypes.tex
 python/branches/p3yk/Doc/tools/undoc_symbols.py
 python/branches/p3yk/Lib/rexec.py
 python/branches/p3yk/Lib/test/test_bz2.py
 python/branches/p3yk/Lib/test/test_decimal.py
 python/branches/p3yk/Lib/test/test_file.py
 python/branches/p3yk/Misc/python.man
 python/branches/p3yk/Modules/bz2module.c
 python/branches/p3yk/Objects/fileobject.c
 python/branches/p3yk/README
Log:
Get rid of xreadlines() (methods).
Modified: python/branches/p3yk/Doc/lib/libbz2.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libbz2.tex	(original)
+++ python/branches/p3yk/Doc/lib/libbz2.tex	Fri Mar 17 09:29:44 2006
@@ -79,15 +79,6 @@
 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,
Modified: python/branches/p3yk/Doc/lib/libstdtypes.tex
==============================================================================
--- python/branches/p3yk/Doc/lib/libstdtypes.tex	(original)
+++ python/branches/p3yk/Doc/lib/libstdtypes.tex	Fri Mar 17 09:29:44 2006
@@ -1583,12 +1583,6 @@
 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}
Modified: python/branches/p3yk/Doc/tools/undoc_symbols.py
==============================================================================
--- python/branches/p3yk/Doc/tools/undoc_symbols.py	(original)
+++ python/branches/p3yk/Doc/tools/undoc_symbols.py	Fri Mar 17 09:29:44 2006
@@ -50,7 +50,7 @@
 
 def findnames(file, prefixes=()):
 names = {}
- for line in file.xreadlines():
+ for line in file:
 if line[0] == '!':
 continue
 fields = line.split()
Modified: python/branches/p3yk/Lib/rexec.py
==============================================================================
--- python/branches/p3yk/Lib/rexec.py	(original)
+++ python/branches/p3yk/Lib/rexec.py	Fri Mar 17 09:29:44 2006
@@ -29,7 +29,7 @@
 class FileBase:
 
 ok_file_methods = ('fileno', 'flush', 'isatty', 'read', 'readline',
- 'readlines', 'seek', 'tell', 'write', 'writelines', 'xreadlines',
+ 'readlines', 'seek', 'tell', 'write', 'writelines', 
 '__iter__')
 
 
Modified: python/branches/p3yk/Lib/test/test_bz2.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_bz2.py	(original)
+++ python/branches/p3yk/Lib/test/test_bz2.py	Fri Mar 17 09:29:44 2006
@@ -110,14 +110,6 @@
 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 @@
 bz2f.close()
 self.assertEqual(lines, ['Test'])
 bz2f = BZ2File(self.filename)
- xlines = list(bz2f.xreadlines())
+ xlines = list(bz2f.readlines())
 bz2f.close()
 self.assertEqual(lines, ['Test'])
 
Modified: python/branches/p3yk/Lib/test/test_decimal.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_decimal.py	(original)
+++ python/branches/p3yk/Lib/test/test_decimal.py	Fri Mar 17 09:29:44 2006
@@ -132,7 +132,7 @@
 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:
Modified: python/branches/p3yk/Lib/test/test_file.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_file.py	(original)
+++ python/branches/p3yk/Lib/test/test_file.py	Fri Mar 17 09:29:44 2006
@@ -179,7 +179,7 @@
 
 methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write',
- 'xreadlines', '__iter__']
+ '__iter__']
 if sys.platform.startswith('atheos'):
 methods.remove('truncate')
 
Modified: python/branches/p3yk/Misc/python.man
==============================================================================
--- python/branches/p3yk/Misc/python.man	(original)
+++ python/branches/p3yk/Misc/python.man	Fri Mar 17 09:29:44 2006
@@ -152,7 +152,7 @@
 .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.
Modified: python/branches/p3yk/Modules/bz2module.c
==============================================================================
--- python/branches/p3yk/Modules/bz2module.c	(original)
+++ python/branches/p3yk/Modules/bz2module.c	Fri Mar 17 09:29:44 2006
@@ -778,13 +778,6 @@
 	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 @@
 	{"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__},
Modified: python/branches/p3yk/Objects/fileobject.c
==============================================================================
--- python/branches/p3yk/Objects/fileobject.c	(original)
+++ python/branches/p3yk/Objects/fileobject.c	Fri Mar 17 09:29:44 2006
@@ -1675,12 +1675,6 @@
 "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 @@
 	{"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},
Modified: python/branches/p3yk/README
==============================================================================
--- python/branches/p3yk/README	(original)
+++ python/branches/p3yk/README	Fri Mar 17 09:29:44 2006
@@ -504,9 +504,9 @@
 
 	 _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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /