Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7096760b
Commit
7096760b
authored
Mar 17, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of xreadlines() (methods).
parent
7c307243
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
9 additions
and
47 deletions
+9
-47
Doc/lib/libbz2.tex
Doc/lib/libbz2.tex
+0
-9
Doc/lib/libstdtypes.tex
Doc/lib/libstdtypes.tex
+0
-6
Doc/tools/undoc_symbols.py
Doc/tools/undoc_symbols.py
+1
-1
Lib/rexec.py
Lib/rexec.py
+1
-1
Lib/test/test_bz2.py
Lib/test/test_bz2.py
+1
-9
Lib/test/test_decimal.py
Lib/test/test_decimal.py
+1
-1
Lib/test/test_file.py
Lib/test/test_file.py
+1
-1
Misc/python.man
Misc/python.man
+1
-1
Modules/bz2module.c
Modules/bz2module.c
+0
-8
Objects/fileobject.c
Objects/fileobject.c
+0
-7
README
README
+3
-3
No files found.
Doc/lib/libbz2.tex
View file @
7096760b
...
@@ -79,15 +79,6 @@ Return a list of lines read. The optional \var{size} argument, if given,
...
@@ -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.
is an approximate bound on the total number of bytes in the lines returned.
\end{methoddesc}
\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
}}
\begin{methoddesc}
[BZ2File]
{
seek
}{
offset
\optional
{
, whence
}}
Move to new file position. Argument
\var
{
offset
}
is a byte count. Optional
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,
argument
\var
{
whence
}
defaults to
\code
{
0
}
(offset from start of file,
...
...
Doc/lib/libstdtypes.tex
View file @
7096760b
...
@@ -1583,12 +1583,6 @@ flush the read-ahead buffer.
...
@@ -1583,12 +1583,6 @@ flush the read-ahead buffer.
implemented, or cannot be implemented efficiently.
implemented, or cannot be implemented efficiently.
\end{methoddesc}
\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
}}
\begin{methoddesc}
[file]
{
seek
}{
offset
\optional
{
, whence
}}
Set the file's current position, like
\code
{
stdio
}
's
\cfunction
{
fseek()
}
.
Set the file's current position, like
\code
{
stdio
}
's
\cfunction
{
fseek()
}
.
The
\var
{
whence
}
argument is optional and defaults to
\code
{
0
}
The
\var
{
whence
}
argument is optional and defaults to
\code
{
0
}
...
...
Doc/tools/undoc_symbols.py
View file @
7096760b
...
@@ -50,7 +50,7 @@ import os, glob, re, sys
...
@@ -50,7 +50,7 @@ import os, glob, re, sys
def
findnames
(
file
,
prefixes
=
()):
def
findnames
(
file
,
prefixes
=
()):
names
=
{}
names
=
{}
for
line
in
file
.
xreadlines
()
:
for
line
in
file
:
if
line
[
0
]
==
'!'
:
if
line
[
0
]
==
'!'
:
continue
continue
fields
=
line
.
split
()
fields
=
line
.
split
()
...
...
Lib/rexec.py
View file @
7096760b
...
@@ -29,7 +29,7 @@ __all__ = ["RExec"]
...
@@ -29,7 +29,7 @@ __all__ = ["RExec"]
class
FileBase
:
class
FileBase
:
ok_file_methods
=
(
'fileno'
,
'flush'
,
'isatty'
,
'read'
,
'readline'
,
ok_file_methods
=
(
'fileno'
,
'flush'
,
'isatty'
,
'read'
,
'readline'
,
'readlines'
,
'seek'
,
'tell'
,
'write'
,
'writelines'
,
'xreadlines'
,
'readlines'
,
'seek'
,
'tell'
,
'write'
,
'writelines'
,
'__iter__'
)
'__iter__'
)
...
...
Lib/test/test_bz2.py
View file @
7096760b
...
@@ -110,14 +110,6 @@ class BZ2FileTest(BaseTest):
...
@@ -110,14 +110,6 @@ class BZ2FileTest(BaseTest):
self
.
assertEqual
(
list
(
iter
(
bz2f
)),
sio
.
readlines
())
self
.
assertEqual
(
list
(
iter
(
bz2f
)),
sio
.
readlines
())
bz2f
.
close
()
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
):
def
testUniversalNewlinesLF
(
self
):
# "Test BZ2File.read() with universal newlines (\\n)"
# "Test BZ2File.read() with universal newlines (\\n)"
self
.
createTempFile
()
self
.
createTempFile
()
...
@@ -256,7 +248,7 @@ class BZ2FileTest(BaseTest):
...
@@ -256,7 +248,7 @@ class BZ2FileTest(BaseTest):
bz2f
.
close
()
bz2f
.
close
()
self
.
assertEqual
(
lines
,
[
'Test'
])
self
.
assertEqual
(
lines
,
[
'Test'
])
bz2f
=
BZ2File
(
self
.
filename
)
bz2f
=
BZ2File
(
self
.
filename
)
xlines
=
list
(
bz2f
.
x
readlines
())
xlines
=
list
(
bz2f
.
readlines
())
bz2f
.
close
()
bz2f
.
close
()
self
.
assertEqual
(
lines
,
[
'Test'
])
self
.
assertEqual
(
lines
,
[
'Test'
])
...
...
Lib/test/test_decimal.py
View file @
7096760b
...
@@ -132,7 +132,7 @@ class DecimalTest(unittest.TestCase):
...
@@ -132,7 +132,7 @@ class DecimalTest(unittest.TestCase):
if
skip_expected
:
if
skip_expected
:
raise
TestSkipped
raise
TestSkipped
return
return
for
line
in
open
(
file
)
.
xreadlines
()
:
for
line
in
open
(
file
):
line
=
line
.
replace
(
'
\
r
\
n
'
,
''
).
replace
(
'
\
n
'
,
''
)
line
=
line
.
replace
(
'
\
r
\
n
'
,
''
).
replace
(
'
\
n
'
,
''
)
#print line
#print line
try
:
try
:
...
...
Lib/test/test_file.py
View file @
7096760b
...
@@ -179,7 +179,7 @@ for s in (-1, 0, 1, 512):
...
@@ -179,7 +179,7 @@ for s in (-1, 0, 1, 512):
methods
=
[
'fileno'
,
'flush'
,
'isatty'
,
'next'
,
'read'
,
'readinto'
,
methods
=
[
'fileno'
,
'flush'
,
'isatty'
,
'next'
,
'read'
,
'readinto'
,
'readline'
,
'readlines'
,
'seek'
,
'tell'
,
'truncate'
,
'write'
,
'readline'
,
'readlines'
,
'seek'
,
'tell'
,
'truncate'
,
'write'
,
'
xreadlines'
,
'
__iter__'
]
'__iter__'
]
if
sys
.
platform
.
startswith
(
'atheos'
):
if
sys
.
platform
.
startswith
(
'atheos'
):
methods
.
remove
(
'truncate'
)
methods
.
remove
(
'truncate'
)
...
...
Misc/python.man
View file @
7096760b
...
@@ -152,7 +152,7 @@ expressed in spaces. Issue an error when the option is given twice.
...
@@ -152,7 +152,7 @@ expressed in spaces. Issue an error when the option is given twice.
.B \-u
.B \-u
Force stdin, stdout and stderr to be totally unbuffered. On systems
Force stdin, stdout and stderr to be totally unbuffered. On systems
where it matters, also put stdin, stdout and stderr in binary mode.
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
file-object iterators ("for line in sys.stdin") which is not
influenced by this option. To work around this, you will want to use
influenced by this option. To work around this, you will want to use
"sys.stdin.readline()" inside a "while 1:" loop.
"sys.stdin.readline()" inside a "while 1:" loop.
...
...
Modules/bz2module.c
View file @
7096760b
...
@@ -778,13 +778,6 @@ BZ2File_readlines(BZ2FileObject *self, PyObject *args)
...
@@ -778,13 +778,6 @@ BZ2File_readlines(BZ2FileObject *self, PyObject *args)
return
list
;
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__
,
PyDoc_STRVAR
(
BZ2File_write__doc__
,
"write(data) -> None
\n
\
"write(data) -> None
\n
\
\n
\
\n
\
...
@@ -1183,7 +1176,6 @@ static PyMethodDef BZ2File_methods[] = {
...
@@ -1183,7 +1176,6 @@ static PyMethodDef BZ2File_methods[] = {
{
"read"
,
(
PyCFunction
)
BZ2File_read
,
METH_VARARGS
,
BZ2File_read__doc__
},
{
"read"
,
(
PyCFunction
)
BZ2File_read
,
METH_VARARGS
,
BZ2File_read__doc__
},
{
"readline"
,
(
PyCFunction
)
BZ2File_readline
,
METH_VARARGS
,
BZ2File_readline__doc__
},
{
"readline"
,
(
PyCFunction
)
BZ2File_readline
,
METH_VARARGS
,
BZ2File_readline__doc__
},
{
"readlines"
,
(
PyCFunction
)
BZ2File_readlines
,
METH_VARARGS
,
BZ2File_readlines__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__
},
{
"write"
,
(
PyCFunction
)
BZ2File_write
,
METH_VARARGS
,
BZ2File_write__doc__
},
{
"writelines"
,
(
PyCFunction
)
BZ2File_writelines
,
METH_O
,
BZ2File_writelines__doc__
},
{
"writelines"
,
(
PyCFunction
)
BZ2File_writelines
,
METH_O
,
BZ2File_writelines__doc__
},
{
"seek"
,
(
PyCFunction
)
BZ2File_seek
,
METH_VARARGS
,
BZ2File_seek__doc__
},
{
"seek"
,
(
PyCFunction
)
BZ2File_seek
,
METH_VARARGS
,
BZ2File_seek__doc__
},
...
...
Objects/fileobject.c
View file @
7096760b
...
@@ -1675,12 +1675,6 @@ PyDoc_STRVAR(readlines_doc,
...
@@ -1675,12 +1675,6 @@ PyDoc_STRVAR(readlines_doc,
"The optional size argument, if given, is an approximate bound on the
\n
"
"The optional size argument, if given, is an approximate bound on the
\n
"
"total number of bytes in the lines returned."
);
"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
,
PyDoc_STRVAR
(
writelines_doc
,
"writelines(sequence_of_strings) -> None. Write the strings to the file.
\n
"
"writelines(sequence_of_strings) -> None. Write the strings to the file.
\n
"
"
\n
"
"
\n
"
...
@@ -1719,7 +1713,6 @@ static PyMethodDef file_methods[] = {
...
@@ -1719,7 +1713,6 @@ static PyMethodDef file_methods[] = {
{
"tell"
,
(
PyCFunction
)
file_tell
,
METH_NOARGS
,
tell_doc
},
{
"tell"
,
(
PyCFunction
)
file_tell
,
METH_NOARGS
,
tell_doc
},
{
"readinto"
,
(
PyCFunction
)
file_readinto
,
METH_VARARGS
,
readinto_doc
},
{
"readinto"
,
(
PyCFunction
)
file_readinto
,
METH_VARARGS
,
readinto_doc
},
{
"readlines"
,
(
PyCFunction
)
file_readlines
,
METH_VARARGS
,
readlines_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
},
{
"writelines"
,(
PyCFunction
)
file_writelines
,
METH_O
,
writelines_doc
},
{
"flush"
,
(
PyCFunction
)
file_flush
,
METH_NOARGS
,
flush_doc
},
{
"flush"
,
(
PyCFunction
)
file_flush
,
METH_NOARGS
,
flush_doc
},
{
"close"
,
(
PyCFunction
)
file_close
,
METH_NOARGS
,
close_doc
},
{
"close"
,
(
PyCFunction
)
file_close
,
METH_NOARGS
,
close_doc
},
...
...
README
View file @
7096760b
...
@@ -504,9 +504,9 @@ Cray T3E: Mark Hadfield (m.hadfield@niwa.co.nz) writes:
...
@@ -504,9 +504,9 @@ Cray T3E: Mark Hadfield (m.hadfield@niwa.co.nz) writes:
_codecs, _locale, _socket, _symtable, _testcapi, _weakref
_codecs, _locale, _socket, _symtable, _testcapi, _weakref
array, binascii, cmath, cPickle, crypt, cStringIO, dbm
array, binascii, cmath, cPickle, crypt, cStringIO, dbm
errno, fcntl, grp, math, md5, operator, parser, p
cre, p
wd
errno, fcntl, grp, math, md5, operator, parser, pwd
r
egex, rotor, select, struct, strop, syslog, termios
r
otor, select, struct, strop, syslog, termios,
time, timing
, xreadlines
time, timing
4) Once the python executable and library have been built, make
4) Once the python executable and library have been built, make
will execute setup.py, which will attempt to build remaining
will execute setup.py, which will attempt to build remaining
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment