def __add__(self, other: 'AsyncObservable[T]') -> 'AsyncObservable[T]': """Pythonic version of concat Example: zs = xs + ys Returns concat(other, self)""" from aioreactive.operators.concat import concat return concat(self, other)
def __iadd__(self, other: 'AsyncObservable[T]') -> 'AsyncObservable[T]': """Pythonic use of concat Example: xs += ys Returns self.concat(other, self)""" from aioreactive.operators.concat import concat return concat(self, other)
async def test_concat_happy(): xs = from_iterable(range(5)) ys = from_iterable(range(5, 10)) result = [] async def asend(value): log.debug("test_merge_done:send: ", value) result.append(value) zs = concat(xs, ys) await run(zs, AnonymousAsyncObserver(asend)) assert result == list(range(10))