Filter seemingly empty messages from random messages

This commit is contained in:
Siphalor committed 2020-12-19 13:09:57 +01:00
1 parent e101c81a1e
commit 92f5d30250
2 files changed
+11 -1

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
from collections import AsyncIterable
from typing import Callable, AsyncGenerator
async def async_filter(fun: Callable, iterable: AsyncIterable) -> AsyncGenerator:
async for val in iterable:
if fun(val):
yield val