[pypy-svn] r49539 - pypy/branch/pypy-interp-file/module/bz2
arigo at codespeak.net
arigo at codespeak.net
Fri Dec 7 21:28:22 CET 2007
Author: arigo
Date: Fri Dec 7 21:28:20 2007
New Revision: 49539
Modified:
pypy/branch/pypy-interp-file/module/bz2/interp_bz2.py
Log:
Ah. The docstring says 'buffering' defaults to 0, but the previous app-level
version had a default of -1. The difference in performance for readline()
ad readlines() is huuuuuuuge...
Modified: pypy/branch/pypy-interp-file/module/bz2/interp_bz2.py
==============================================================================
--- pypy/branch/pypy-interp-file/module/bz2/interp_bz2.py (original)
+++ pypy/branch/pypy-interp-file/module/bz2/interp_bz2.py Fri Dec 7 21:28:20 2007
@@ -170,7 +170,7 @@
class W_BZ2File(W_File):
- def direct___init__(self, name, mode='r', buffering=0, compresslevel=9):
+ def direct___init__(self, name, mode='r', buffering=-1, compresslevel=9):
self.direct_close()
# the stream should always be opened in binary mode
if "b" not in mode:
@@ -214,7 +214,7 @@
W_BZ2File.typedef = TypeDef(
"BZ2File",
__doc__ = """\
-BZ2File(name [, mode='r', buffering=0, compresslevel=9]) -> file object
+BZ2File(name [, mode='r', buffering=-1, compresslevel=9]) -> file object
Open a bz2 file. The mode can be 'r' or 'w', for reading (default) or
writing. When opened for writing, the file will be created if it doesn't
More information about the Pypy-commit
mailing list