diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2014-01-10 17:15:58 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2014-01-10 17:15:58 +0100 |
commit | ec37469dc61e0e24db448e9455b2483797afe936 (patch) | |
tree | 2ebfcb3b7ac56107b6301ec96eda095c4f44e052 /Cython/Compiler/ModuleNode.py | |
parent | 85f5c24a5b0618f5aa486b1716bb7dc6191456bd (diff) | |
download | cython-ec37469dc61e0e24db448e9455b2483797afe936.tar.gz |
reuse object's tp_new() for simple extension types if possible to improve support for multiple inheritance
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 13d626b03..827bd9095 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1068,7 +1068,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): type.declaration_code(""))) def generate_new_function(self, scope, code, cclass_entry): - tp_slot = TypeSlots.ConstructorSlot("tp_new", '__new__') + # keep this function in sync with ConstructorSlot.can_reuse_baseobject_tp_new() + tp_slot = TypeSlots.ConstructorSlot("tp_new") slot_func = scope.mangle_internal("tp_new") type = scope.parent_type base_type = type.base_type @@ -1188,7 +1189,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): "}") def generate_dealloc_function(self, scope, code): - tp_slot = TypeSlots.ConstructorSlot("tp_dealloc", '__dealloc__') + tp_slot = TypeSlots.DestructorSlot("tp_dealloc", '__dealloc__') slot_func = scope.mangle_internal("tp_dealloc") base_type = scope.parent_type.base_type if tp_slot.slot_code(scope) != slot_func: |