who needs lambda anyway ...
authorStefan Behnel <scoder@users.berlios.de>
Fri, 25 Apr 2008 21:39:42 +0000 (23:39 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 25 Apr 2008 21:39:42 +0000 (23:39 +0200)
Cython/Compiler/ExprNodes.py

index 7590565c101fba741644eb9264f2142c4f478ead..9129304c82340738c01988bbecf7729a555a1918 100644 (file)
@@ -2853,6 +2853,9 @@ class SizeofVarNode(SizeofNode):
 #
 #-------------------------------------------------------------------
 
+def _not_in(x, seq):
+    return x not in seq
+
 compile_time_binary_operators = {
     '<': operator.lt,
     '<=': operator.le,
@@ -2875,8 +2878,8 @@ compile_time_binary_operators = {
     '-': operator.sub,
     #'/': operator.truediv,
     '^': operator.xor,
-    'in': lambda x, y: x in y,
-    'not_in': lambda x, y: x not in y,
+    'in': operator.contains,
+    'not_in': _not_in,
 }
 
 def get_compile_time_binop(node):