set CYTHON_UNUSED modifier for __index__ special method
authorLisandro Dalcin <dalcinl@gmail.com>
Mon, 16 Aug 2010 18:53:31 +0000 (15:53 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Mon, 16 Aug 2010 18:53:31 +0000 (15:53 -0300)
Cython/Compiler/Nodes.py

index 83bbec11fffdde3cd52940b088fbdea582a48c15..0d5312c027d17063533aca92bb0e0ee759a68673 100644 (file)
@@ -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']