def nodeSetCapableOperator(i1, i2): i1 = unPack(i1) i2 = unPack(i2) type1 = type(i1) type2 = type(i2) if type1 == BooleanType or type2 == BooleanType: return operator(boolean(i1), boolean(i2)) if isaSequence(i1): if isaSequence(i2): i2 = list(i2) return any(i1, lambda i: any(i2, op(i))) return any(i1, op(i2)) if isaSequence(i2): return any(i2, op(i1)) return operator(i1, i2)
def nodeSetCapableOperator(i1, i2) : i1 = unPack(i1) i2 = unPack(i2) type1 = type(i1) type2 = type(i2) if type1 == BooleanType or type2 == BooleanType : return operator(boolean(i1),boolean(i2)) if isaSequence(i1) : if isaSequence(i2) : i2 = list(i2) return any(i1, lambda i : any(i2, op(i))) return any(i1, op(i2)) if isaSequence(i2) : return any(i2, op(i1)) return operator(i1,i2)
def testAny9(self) : self.assert_(any(self.stringIterator(), lambda a: eq(a, "d")))
def testAny5(self) : self.assert_(not any(self.stringList, lambda a: eq(a, "x")))
def testAny4(self) : self.assert_(any(self.stringList, lambda a: eq(a, "d")))
def testAny22(self) : self.assert_(not any(self.emptyIterator(), lambda a: eq(a, 100)))
def sequencesEqual(s1,s2) : return not any(izip(s1,s2), lambda pair: pair[0] != pair[1])
def testAny15(self) : self.assert_(not any(self.numberList, lambda a: eq(a, 100)))
def testAny10(self): self.assert_(not any(self.stringIterator(), lambda a: eq(a, "x")))
def testAny9(self): self.assert_(any(self.stringIterator(), lambda a: eq(a, "d")))
def testAny5(self): self.assert_(not any(self.stringList, lambda a: eq(a, "x")))
def testAny4(self): self.assert_(any(self.stringList, lambda a: eq(a, "d")))
def testAny22(self): self.assert_(not any(self.emptyIterator(), lambda a: eq(a, 100)))
def testAny20(self): self.assert_(not any(self.numberIterator(), lambda a: eq(a, 100)))
def testAny19(self): self.assert_(any(self.numberIterator(), lambda a: eq(a, 4)))
def testAny10(self) : self.assert_(not any(self.stringIterator(), lambda a: eq(a, "x")))
def testAny14(self) : self.assert_(any(self.numberList, lambda a: eq(a, 4)))
def testAny14(self): self.assert_(any(self.numberList, lambda a: eq(a, 4)))
def testAny16(self) : self.assert_(any(self.numberIterator(), lambda a: eq(a, 1)))
def testAny15(self): self.assert_(not any(self.numberList, lambda a: eq(a, 100)))
def sequencesEqual(s1, s2): return not any(izip(s1, s2), lambda pair: pair[0] != pair[1])
def testAny20(self) : self.assert_(not any(self.numberIterator(), lambda a: eq(a, 100)))