From 6b7cd5711eed5d413726501a58270f7f617caf74 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 21 Feb 2013 23:52:15 +0100 Subject: [PATCH] support special comparison methods in method dispatch transforms --- Cython/Compiler/Visitor.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Cython/Compiler/Visitor.py b/Cython/Compiler/Visitor.py index 469d3cc..777e0c0 100644 --- a/Cython/Compiler/Visitor.py +++ b/Cython/Compiler/Visitor.py @@ -492,7 +492,16 @@ class MethodDispatcherTransform(EnvTransform): args = node.args return self._dispatch_to_handler(node, function, args, None) + def visit_PrimaryCmpNode(self, node): + return self._visit_binop_node(node) + + def visit_CascadedCmpNode(self, node): + return self._visit_binop_node(node) + def visit_BinopNode(self, node): + return self._visit_binop_node(node) + + def _visit_binop_node(self, node): self.visitchildren(node) # FIXME: could special case 'not_in' special_method_name = find_special_method_for_binary_operator(node.operator) -- 2.7.4