U
vi @ s d dl mZmZmZ d dlmZmZ d dlmZ d dl m
Z
ddlmZ edZ
dee
e
eee
gee
f d d
dZdgZdS )
)CallableOptionalTypeVar)
Observablecompose) operators) Predicate )first_or_default_async__TN) predicatereturnc C s | rt t| t S tdS )a Returns the first element of an observable sequence that
satisfies the condition in the predicate if present else the first
item in the sequence.
Examples:
>>> res = res = first()(source)
>>> res = res = first(lambda x: x > 3)(source)
Args:
predicate -- [Optional] A predicate function to evaluate for
elements in the source sequence.
Returns:
A function that takes an observable source and returns an
observable sequence containing the first element in the
observable sequence that satisfies the condition in the predicate if
provided, else the first item in the sequence.
F)r opsfilterfirstr
)r r K/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_first.pyfirst_ s r )N)typingr r r Z reactivexr r r r Zreactivex.typingr Z_firstordefaultr
r r __all__r r r r