예제 #1
0
파일: contains.py 프로젝트: wolf937/RxPY
def _contains(value: Any, comparer=None) -> Callable[[Observable], Observable]:
    comparer_ = comparer or default_comparer

    filtering = ops.filter(lambda v: comparer_(v, value))
    something = ops.some()

    return pipe(filtering, something)
예제 #2
0
def _is_empty() -> Callable[[Observable], Observable]:
    """Determines whether an observable sequence is empty.

    Returns:
        An observable sequence containing a single element
        determining whether the source sequence is empty.
    """

    return pipe(ops.some(), ops.map(lambda b: not b))
예제 #3
0
def _all(predicate: Predicate) -> Callable[[Observable], Observable]:

    filtering = ops.filter(lambda v: not predicate(v))
    mapping = ops.map(lambda b: not b)
    some = ops.some()

    return pipe(
        filtering,
        some,
        mapping
    )
예제 #4
0
 def create():
     return xs.pipe(ops.some(lambda x: x > 0))
예제 #5
0
 def create():
     return xs.pipe(ops.some())
예제 #6
0
 def create():
     return xs.pipe(ops.some(lambda x: x > 0))
예제 #7
0
 def create():
     return xs.pipe(ops.some())