From 843804563aa4e3c7fea27fb3742ed3cf4943a99d Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Mon, 16 Aug 2010 15:53:31 -0300 Subject: [PATCH] set CYTHON_UNUSED modifier for __index__ special method --- Cython/Compiler/Nodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 83bbec11..0d5312c0 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1216,7 +1216,9 @@ class FuncDefNode(StatNode, BlockNode): is_releasebuffer_slot = (self.entry.name == "__releasebuffer__" and self.entry.scope.is_c_class_scope) is_buffer_slot = is_getbuffer_slot or is_releasebuffer_slot - if is_buffer_slot: + is_index_slot = (self.entry.name == "__index__" and + self.entry.scope.is_c_class_scope) + if is_buffer_slot or is_index_slot: if 'cython_unused' not in self.modifiers: self.modifiers = self.modifiers + ['cython_unused'] -- 2.26.2