From 5fd59aa5baa26f013e031b72ec1e2b38d188ea00 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 30 Nov 2008 13:04:13 +0100 Subject: [PATCH] fix method signatures --- Cython/Compiler/ExprNodes.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 2996db4b..c6308492 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -3219,10 +3219,12 @@ class DictItemNode(ExprNode): def generate_evaluation_code(self, code): self.key.generate_evaluation_code(code) self.value.generate_evaluation_code(code) - - def generate_disposal_code(self, code): - self.key.generate_disposal_code(code) - self.value.generate_disposal_code(code) + + def generate_disposal_code(self, code, free_temp=True, decref=True): + self.key.generate_disposal_code( + code, free_temp=free_temp, decref=decref) + self.value.generate_disposal_code( + code, free_temp=free_temp, decref=decref) def __iter__(self): return iter([self.key, self.value]) @@ -4765,7 +4767,7 @@ class CloneNode(CoercionNode): def generate_result_code(self, code): pass - def generate_disposal_code(self, code): + def generate_disposal_code(self, code, free_temp=True, decref=True): pass def allocate_temps(self, env): @@ -4811,9 +4813,9 @@ class PersistentNode(ExprNode): self.arg.generate_disposal_code(code) self.generate_counter += 1 - def generate_disposal_code(self, code): + def generate_disposal_code(self, code, free_temp=True, decref=True): if self.generate_counter == self.uses: - if self.type.is_pyobject: + if self.type.is_pyobject and decref: code.put_decref_clear(self.result(), self.ctype()) def allocate_temps(self, env, result=None): -- 2.26.2