Beispiel #1
0
        def predicate(x):
            nonlocal invoked
            invoked += 1
            if invoked == 3:
                raise Exception(ex)

            return is_prime(x)
Beispiel #2
0
 def predicate(x):
     nonlocal invoked
     invoked += 1
     if invoked == 3:
         raise Exception(ex)
     
     return is_prime(x)
Beispiel #3
0
 def predicate(x, index):
     nonlocal invoked
     invoked += 1
     if x == 8:
         d.dispose()
     
     return is_prime(x + index * 10)
Beispiel #4
0
        def predicate(x, index):
            nonlocal invoked
            invoked += 1
            if x > 5:
                raise Exception(ex)

            return is_prime(x + index * 10)
Beispiel #5
0
def test_is_prime():
    assert is_prime(1) == False
    assert is_prime(2) == True
    assert is_prime(3) == True
    assert is_prime(4) == False
    assert is_prime(5) == True
    assert is_prime(6) == False
Beispiel #6
0
def test_is_prime():
    assert not is_prime(1)
    assert is_prime(2)
    assert is_prime(3)
    assert not is_prime(4)
    assert is_prime(5)
    assert not is_prime(6)
def test_is_prime():
    assert not is_prime(1)
    assert is_prime(2)
    assert is_prime(3)
    assert not is_prime(4)
    assert is_prime(5)
    assert not is_prime(6)
Beispiel #8
0
def test_is_prime():
    assert is_prime(1) == False
    assert is_prime(2) == True
    assert is_prime(3) == True
    assert is_prime(4) == False
    assert is_prime(5) == True
    assert is_prime(6) == False
Beispiel #9
0
 def predicate(x):
     invoked[0] += 1
     return is_prime(x)
Beispiel #10
0
 def predicate(x, index):
     invoked[0] += 1
     if x == 8:
         d.dispose()
 
     return is_prime(x + index * 10)
Beispiel #11
0
            def predicate(x, index):
                invoked[0] += 1
                if x > 5:
                    raise Exception(ex)

                return is_prime(x + index * 10)
Beispiel #12
0
 def predicate(x, index):
     invoked[0] += 1
     return is_prime(x + index * 10)
Beispiel #13
0
 def predicate(x):
     invoked[0] += 1
     if x == 8:
         d.dispose()
 
     return is_prime(x)
Beispiel #14
0
            def predicate(x, index):
                invoked[0] += 1
                if x > 5:
                    raise Exception(ex)

                return is_prime(x + index * 10)
Beispiel #15
0
 def predicate(x):
     nonlocal invoked
     invoked += 1
     return is_prime(x)
Beispiel #16
0
            def predicate(x):
                nonlocal invoked

                invoked += 1
                return is_prime(x)
Beispiel #17
0
            def predicate(x):
                invoked[0] += 1
                if x == 8:
                    d.dispose()

                return is_prime(x)
Beispiel #18
0
 def predicate(x, index):
     nonlocal invoked
     invoked += 1
     return is_prime(x + index * 10)
Beispiel #19
0
     def predicate(x):
         invoked[0] += 1
         if invoked[0] == 3:
             raise Exception(ex)
 
         return is_prime(x)
Beispiel #20
0
            def predicate(x, index):
                invoked[0] += 1
                if x == 8:
                    d.dispose()

                return is_prime(x + index * 10)
Beispiel #21
0
            def predicate(x):
                invoked[0] += 1
                if invoked[0] == 3:
                    raise Exception(ex)

                return is_prime(x)
Beispiel #22
0
 def predicate(x):
     invoked[0] += 1
     return is_prime(x)
Beispiel #23
0
 def predicate(x, index):
     invoked[0] += 1
     return is_prime(x + index * 10)