but we can get away with skipping intermediate classes if nothing new happens
def generate_new_function(self, scope, code):
tp_slot = TypeSlots.ConstructorSlot("tp_new", '__new__')
slot_func = scope.mangle_internal("tp_new")
- if tp_slot.slot_code(scope) != slot_func:
- return # never used
type = scope.parent_type
base_type = type.base_type
py_attrs = []
MethodSlot(initproc, "tp_init", "__init__"),
EmptySlot("tp_alloc"), #FixedSlot("tp_alloc", "PyType_GenericAlloc"),
- ConstructorSlot("tp_new", '__new__'),
+ InternalMethodSlot("tp_new"),
EmptySlot("tp_free"),
EmptySlot("tp_is_gc"),