Commit 73011bd8 authored by Robert Bradshaw's avatar Robert Bradshaw

tp_new must always be generated to set the vtab

but we can get away with skipping intermediate classes if nothing new happens
parent 3a9b5215
......@@ -610,8 +610,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
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 = []
......
......@@ -643,7 +643,7 @@ slot_table = (
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"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment