コード例 #1
0
ファイル: test_while.py プロジェクト: AlexMost/RxPY
 def create():
     def predicate(x):
         n[0] += 1
         if n[0] < 3:
             return True
         else:
             raise Exception(ex)
         
     return Observable.while_do(predicate, xs)
コード例 #2
0
ファイル: test_while.py プロジェクト: zorosteven/RxPY
        def create():
            def predicate(x):
                n[0] += 1
                if n[0] < 3:
                    return True
                else:
                    raise Exception(ex)

            return Observable.while_do(predicate, xs)
コード例 #3
0
ファイル: dowhile.py プロジェクト: jesonjn/RxPY
    def do_while(self, condition):
        """Repeats source as long as condition holds emulating a do while loop.
        
        Keyword arguments:
        condition -- {Function} The condition which determines if the source 
            will be repeated.
        
        Returns an observable {Observable} sequence which is repeated as long 
        as the condition holds."""

        return Observable.concat([self, Observable.while_do(condition, self)])
コード例 #4
0
ファイル: dowhile.py プロジェクト: jesonjn/RxPY
    def do_while(self, condition):
        """Repeats source as long as condition holds emulating a do while loop.
        
        Keyword arguments:
        condition -- {Function} The condition which determines if the source 
            will be repeated.
        
        Returns an observable {Observable} sequence which is repeated as long 
        as the condition holds."""
 
        return Observable.concat([self, Observable.while_do(condition, self)])
コード例 #5
0
ファイル: test_while.py プロジェクト: AlexMost/RxPY
 def create():
     def predicate(x):
         n[0] += 1
         return n[0] < 3
     return Observable.while_do(predicate, xs)
コード例 #6
0
ファイル: test_while.py プロジェクト: AlexMost/RxPY
 def create():
     return Observable.while_do(lambda _: True, xs)
コード例 #7
0
ファイル: test_while.py プロジェクト: zorosteven/RxPY
        def create():
            def predicate(x):
                n[0] += 1
                return n[0] < 3

            return Observable.while_do(predicate, xs)
コード例 #8
0
ファイル: test_while.py プロジェクト: zorosteven/RxPY
 def create():
     return Observable.while_do(lambda _: True, xs)