# HG changeset patch # User Paul Boddie # Date 1480436754 -3600 # Node ID 661a64c3c23729f5ca867ace14b253a1c1069f1e # Parent a2cb05a2a44b089f6e52cbefb6e1bad88f07669c Fixed "in" and "not in" operator parameter usage. Removed a reminder comment that should be placed elsewhere. diff -r a2cb05a2a44b -r 661a64c3c237 lib/operator/binary.py --- a/lib/operator/binary.py Tue Nov 29 16:43:58 2016 +0100 +++ b/lib/operator/binary.py Tue Nov 29 17:25:54 2016 +0100 @@ -25,9 +25,6 @@ # lambda functions. Thus, the appropriate methods are defined locally, but no # attempt to obtain them is made until the generic function is called. -# NOTE: The compiler should make it possible for the following functions to call -# NOTE: the generic operator implementations with no additional call overhead. - # Binary operator functions. def add(a, b): @@ -46,10 +43,10 @@ return binary_op(a, b, lambda a: a.__floordiv__, lambda b: b.__rfloordiv__) def in_(a, b): - return a.__contains__(b) + return b.__contains__(a) def not_in(a, b): - return not a.__contains__(b) + return not b.__contains__(a) def lshift(a, b): return binary_op(a, b, lambda a: a.__lshift__, lambda b: b.__rlshift__)