def create(): def predicate(x): n[0] += 1 if n[0] < 3: return True else: raise Exception(ex) return Observable.while_do(predicate, xs)
def create(): def predicate(x): n[0] += 1 if n[0] < 3: return True else: raise Exception(ex) return Observable.while_do(predicate, xs)
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)])
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)])
def create(): def predicate(x): n[0] += 1 return n[0] < 3 return Observable.while_do(predicate, xs)
def create(): return Observable.while_do(lambda _: True, xs)
def create(): def predicate(x): n[0] += 1 return n[0] < 3 return Observable.while_do(predicate, xs)
def create(): return Observable.while_do(lambda _: True, xs)