I want to create a stream from a simple list, let's say [1, 2, 3]. How do I do that? What I managed to do is:
@operator
async def out():
for x in [1,2,3]:
yield x
async def main():
async for x in out():
print(x)
If this is the simplest way I would suggest ehancing somehow operator function to accept a synchronous iterables or creating a dedicated function for that.
I want to create a stream from a simple list, let's say
[1, 2, 3]
. How do I do that? What I managed to do is:If this is the simplest way I would suggest ehancing somehow
operator
function to accept a synchronous iterables or creating a dedicated function for that.