U vi@sbddlmZmZmZddlmZmZedZdeeeeegeeefdddZdgZ dS) )CallableOptionalTypeVar) Observableabc_TN) default_valuereturncs$tttttdfdd }|S)N)sourcer cs4dtjttttjtjdfdd }t|S)aReturns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. Examples: >>> obs = default_if_empty(source) Args: source: Source observable. Returns: An observable sequence that contains the specified default value if the source is empty otherwise, the elements of the source. N)observer schedulerr cs>dgtdfdd }fdd}j|j||dS)NFxcsdd<|dS)NTr)on_nextr foundr T/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_defaultifempty.pyr"szOdefault_if_empty_..default_if_empty..subscribe..on_nextcsdsdS)Nr)r on_completedr)rrr rrr&s zTdefault_if_empty_..default_if_empty..subscribe..on_completed)r )r subscribeZon_error)r r rr)rr rrrsz>default_if_empty_..default_if_empty..subscribe)N)rZ ObserverBaserrZ SchedulerBaseZDisposableBaser)r rr)r rdefault_if_empty s z+default_if_empty_..default_if_empty)rrr)rrrrrdefault_if_empty_s &r)N) typingrrrZ reactivexrrrr__all__rrrrs ,