[Python-bugs-list] [ python-Bugs-540965 ] PyType_GenericNew broken

noreply@sourceforge.net noreply@sourceforge.net
Mon, 08 Apr 2002 05:24:16 -0700


Bugs item #540965, was opened at 2002-04-08 12:24
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=540965&group_id=5470

Category: Type/class unification
Group: Python 2.2.1 candidate
Status: Open
Resolution: None
Priority: 5
Submitted By: Ralf Juengling (rjuengling)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyType_GenericNew broken

Initial Comment:
A new Python type/class _A is implemented in C.
It needs a special allocator function, thus
tp_alloc=_A_alloc for this type. There is no need
for a special new-method, however, thus
tp_new=PyType_GenericNew for this type.

The class A inherits from _A and is implemented
in Python:

class A(_A):
	pass

When an instance of _A is created, its allocator
function _A_alloc gets invoked. When an instance 
of A is created, the _A_alloc does not get invoked.


PyType_GenericNew should also invoke all allocator 
functions of the argument type's superclasses (in 
reverse mro, I think).



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=540965&group_id=5470