cpython Log


Commit Date  
[ee10d7] by Gustavo Niemeyer Gustavo Niemeyer

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.

2003-02-11 18:46:20 Tree
[59fbae] by Guido van Rossum Guido van Rossum

Put proper tests in classmethod_get(). Remove the type argument to
descr_check(); it wasn't useful. Change the type argument of the
various _get() methods to PyObject * because the call signature of
tp_descr_get doesn't guarantee its type.

2003-02-11 18:44:42 Tree
[bf083e] by Guido van Rossum Guido van Rossum

Refactor instancemethod_descr_get() to (a) be more clear, (b) be safe
in the light of weird args, and (c) not to expect None (which is now
changed to NULL by slot_tp_descr_get()).

2003-02-11 18:43:00 Tree
[cb1eea] by Tim Peters Tim Peters

SF bug 684667: Modules/selectmodule.c returns NULL without exception set.
select_select() didn't set an exception in the SELECT_USES_HEAP case when
malloc() returned NULL.

2003-02-11 17:18:58 Tree
[48dc4a] by Guido van Rossum Guido van Rossum

Inline create_specialmethod() -- since METH_CLASS is done differently
now, it was only called once, and its existence merely obfuscates the
control flow.

2003-02-11 17:12:46 Tree
[f6c95f] by Tim Peters Tim Peters

Added tests to ensure that list and dict "chunking" are actually
getting done. Since this isn't yet implemented in cPickle, the
new tests are in TempAbstractPickleTests (which cPickle doesn't
run).

2003-02-11 16:40:16 Tree
[cd05af] by Jack Jansen Jack Jansen

- More int() calls around floating point numbers passed where integers are
expected.
- Fixed resizing of multi-column lists, somewhat.

2003-02-11 16:26:26 Tree
[42396a] by Guido van Rossum Guido van Rossum

Add basic arg sanity checking to wrap_descr_get(). This is called
when Python code calls a descriptor's __get__ method. It should
translate None to NULL in both argument positions, and insist that at
least one of the argument positions is not NULL after this
transformation.

2003-02-11 16:25:43 Tree
[5663e0] by Neal Norwitz Neal Norwitz

Remove duplicate word (rules)

2003-02-11 14:30:39 Tree
[8d6ee1] by Michael W. Hudson Michael W. Hudson

Fix so it compiles at least.

"make lib" takes a while, doesn't it?

2003-02-11 14:24:13 Tree
Older >