diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2003-02-11 18:46:20 (GMT) |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2003-02-11 18:46:20 (GMT) |
commit | a33d0aa693610742b7bb364b0ab0dfa6076bdc4f (patch) | |
tree | 1a905c88a8f865b73b8515d9cc5acdf720208987 /Doc/lib | |
parent | b6e5a0c6587420ba666d5402a8aefd20b9f8c507 (diff) | |
download | cpython-a33d0aa693610742b7bb364b0ab0dfa6076bdc4f.zip cpython-a33d0aa693610742b7bb364b0ab0dfa6076bdc4f.tar.gz cpython-a33d0aa693610742b7bb364b0ab0dfa6076bdc4f.tar.bz2 |
Unparenting BZ2File, as discussed in SF patch #661796.
* Modules/bz2module.c
(BZ2FileObject): Now the structure includes a pointer to a file object,
instead of "inheriting" one. Also, some members were copied from the
PyFileObject structure to avoid dealing with the internals of that
structure from outside fileobject.c.
(Util_GetLine,Util_DropReadAhead,Util_ReadAhead,Util_ReadAheadGetLineSkip,
BZ2File_write,BZ2File_writelines,BZ2File_init,BZ2File_dealloc,
BZ2Comp_dealloc,BZ2Decomp_dealloc):
These functions were adapted to the change above.
(BZ2File_seek,BZ2File_close): Use PyObject_CallMethod instead of
getting the function attribute locally.
(BZ2File_notsup): Removed, since it's not necessary anymore to overload
truncate(), and readinto() with dummy functions.
(BZ2File_methods): Added xreadlines() as an alias to BZ2File_getiter,
and removed truncate() and readinto().
(BZ2File_get_newlines,BZ2File_get_closed,BZ2File_get_mode,BZ2File_get_name,
BZ2File_getset):
Implemented getters for "newlines", "mode", and "name".
(BZ2File_members): Implemented "softspace" member.
(BZ2File_init): Reworked to create a file instance instead of initializing
itself as a file subclass. Also, pass "name" object untouched to the
file constructor, and use PyObject_CallFunction instead of building the
argument tuple locally.
(BZ2File_Type): Set tp_new to PyType_GenericNew, tp_members to
BZ2File_members, and tp_getset to BZ2File_getset.
(initbz2): Do not set BZ2File_Type.tp_base nor BZ2File_Type.tp_new.
* Doc/lib/libbz2.tex
Do not mention that BZ2File inherits from the file type.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libbz2.tex | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Doc/lib/libbz2.tex b/Doc/lib/libbz2.tex index d836500..439f2ba 100644 --- a/Doc/lib/libbz2.tex +++ b/Doc/lib/libbz2.tex @@ -23,8 +23,6 @@ Here is a resume of the features offered by the bz2 module: \item \class{BZ2File} class implements universal newline support; \item \class{BZ2File} class offers an optimized line iteration using the readahead algorithm borrowed from file objects; -\item \class{BZ2File} class inherits from the builtin file type - (\code{issubclass(BZ2File, file)} is \code{True}); \item Sequential (de)compression supported by \class{BZ2Compressor} and \class{BZ2Decompressor} classes; \item One-shot (de)compression supported by \function{compress()} and |