U viO @sddlmZmZmZmZmZmZddlZddlmZm Z edZ edZ eeeeegeeedffddd Z ee eee geee e ffd d d Z d d gZdS) )AnyCallableIterableOptionalTupleTypeVarN) Observableabc_T_TOther.)argsreturncs(tttttdfdfdd }|S)N.sourcer cstj|fS)aMerges the specified observable sequences into one observable sequence by creating a tuple whenever all of the observable sequences have produced an element at a corresponding index. Example: >>> res = zip(source) Args: source: Source observable to zip. Returns: An observable sequence containing the result of combining elements of the sources as a tuple. ) reactivexzip)rr I/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_zip.py_zip szzip_.._zip)rrr)r rrrrzip_ s$r)seqr cs(ttttttfdfdd }|S)Nrcs@|tdtjtttfttjdfdd }t|S)aMerges the specified observable sequence and list into one observable sequence by creating a tuple whenever all of the observable sequences have produced an element at a corresponding index. Example >>> res = zip(source) Args: source: Source observable to zip. Returns: An observable sequence containing the result of combining elements of the sources as a tuple. N)observer schedulercs2dtddfdd }j|jj|dS)Nr)leftr cs@z t}Wntk r(YnX||f}|dS)N)next StopIteration on_completedon_next)rrightresult)indexrsecondrrr?s  zQzip_with_iterable_..zip_with_iterable..subscribe..on_next)r)r subscribeZon_errorr)rrrfirstr")r!rrr#9s z@zip_with_iterable_..zip_with_iterable..subscribe)N) iterr Z ObserverBaserr r rZ SchedulerBaser)rr#rr$rzip_with_iterable%sz-zip_with_iterable_..zip_with_iterable)rr rr )rr(rr'rzip_with_iterable_"s$+r))typingrrrrrrrrr r r rr)__all__rrrrs   1