Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 def testAny9(self) :
   self.assert_(any(self.stringIterator(), lambda a: eq(a, "d")))
Beispiel #4
0
 def testAny5(self) :
   self.assert_(not any(self.stringList, lambda a: eq(a, "x")))
Beispiel #5
0
 def testAny4(self) :
   self.assert_(any(self.stringList, lambda a: eq(a, "d")))
Beispiel #6
0
 def testAny22(self) :
   self.assert_(not any(self.emptyIterator(), lambda a: eq(a, 100)))
Beispiel #7
0
def sequencesEqual(s1,s2) :
  return not any(izip(s1,s2), lambda pair: pair[0] != pair[1])
Beispiel #8
0
 def testAny15(self) :
   self.assert_(not any(self.numberList, lambda a: eq(a, 100)))
Beispiel #9
0
 def testAny10(self):
     self.assert_(not any(self.stringIterator(), lambda a: eq(a, "x")))
Beispiel #10
0
 def testAny9(self):
     self.assert_(any(self.stringIterator(), lambda a: eq(a, "d")))
Beispiel #11
0
 def testAny5(self):
     self.assert_(not any(self.stringList, lambda a: eq(a, "x")))
Beispiel #12
0
 def testAny4(self):
     self.assert_(any(self.stringList, lambda a: eq(a, "d")))
Beispiel #13
0
 def testAny22(self):
     self.assert_(not any(self.emptyIterator(), lambda a: eq(a, 100)))
Beispiel #14
0
 def testAny20(self):
     self.assert_(not any(self.numberIterator(), lambda a: eq(a, 100)))
Beispiel #15
0
 def testAny19(self):
     self.assert_(any(self.numberIterator(), lambda a: eq(a, 4)))
Beispiel #16
0
 def testAny10(self) :
   self.assert_(not any(self.stringIterator(), lambda a: eq(a, "x")))
Beispiel #17
0
 def testAny14(self) :
   self.assert_(any(self.numberList, lambda a: eq(a, 4)))
Beispiel #18
0
 def testAny14(self):
     self.assert_(any(self.numberList, lambda a: eq(a, 4)))
Beispiel #19
0
 def testAny16(self) :
   self.assert_(any(self.numberIterator(), lambda a: eq(a, 1)))
Beispiel #20
0
 def testAny15(self):
     self.assert_(not any(self.numberList, lambda a: eq(a, 100)))
Beispiel #21
0
def sequencesEqual(s1, s2):
    return not any(izip(s1, s2), lambda pair: pair[0] != pair[1])
Beispiel #22
0
 def testAny20(self) :
   self.assert_(not any(self.numberIterator(), lambda a: eq(a, 100)))