From: Stefan Behnel Date: Fri, 25 Apr 2008 21:39:42 +0000 (+0200) Subject: who needs lambda anyway ... X-Git-Tag: 0.9.6.14~20^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d737fed4eee08788aa44d8104ada04883abc1e3d;p=cython.git who needs lambda anyway ... --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 7590565c..9129304c 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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):