Beispiel #1
0
        def factory():
            def predicate(x):
                nonlocal invoked

                invoked += 1
                return is_prime(x)

            return xs.pipe(ops.take_while(predicate))
Beispiel #2
0
        def factory():
            def predicate(x):
                nonlocal invoked

                invoked += 1
                if invoked == 3:
                    raise Exception(ex)

                return is_prime(x)

            return xs.pipe(ops.take_while(predicate))