U vi@sbddlmZmZmZmZddlmZmZddlm Z m Z eeeeedfdddZ dgZ dS) )AnyListOptionalTuple) Observableabc)CompositeDisposableSingleAssignmentDisposable.)sourcesreturncs6ddtjtttjtdfdd }t|S)aeMerges the specified observable sequences into one observable sequence by creating a tuple whenever any of the observable sequences produces an element. Examples: >>> obs = combine_latest(obs1, obs2, obs3) Returns: An observable sequence containing the result of combining elements of the sources into a tuple. rN)observer schedulerr c st }dg|dgdg|dg|tddfdd tddfdd dg|tdd  fdd }t|D] }||qtS) NF)ir cs^d<dstr,t}|n"tfddtDrNtd<dS)NTrcsg|]\}}|kr|qSr).0jxrrS/opt/alt/python38/lib/python3.8/site-packages/reactivex/observable/combinelatest.py 'szEcombine_latest_..subscribe.._next..)alltupleon_next enumerate on_completed)rres) has_value has_value_allis_doner valuesrr_next s z1combine_latest_..subscribe.._nextcsd|<trdS)NT)rrr)rr rrdone,sz0combine_latest_..subscribe..donecsht<tddfdd }ddfdd }}|sJtj|j|d|_dS)N)rr c s&j|<W5QRXdSNlock)r)r rparentrrrr6szAcombine_latest_..subscribe..func..on_next)r c sjW5QRXdSr"r#r)r!rr%rrr;szFcombine_latest_..subscribe..func..on_completed)r )r rAssertionError subscribeZon_errorZ disposable)rrrZ subscription)r r!r r%r r subscriptionsrrrfunc3s z0combine_latest_..subscribe..func)lenrintranger)r r nr)idxr%r ) r r!rrrr r r(rrr's     "  z"combine_latest_..subscribe)N)rZ ObserverBaserrZ SchedulerBaserr)r r'rr/rcombine_latest_s 3r0N) typingrrrrZ reactivexrrZreactivex.disposablerr r0__all__rrrrs E