how can I asynchronously map/filter an asynchronous iterable? : <p>Let's say I have an asynchronous iterable that I can pass over using <code>async for</code>, how then can I then map and filter it to a new asynchronous iterator? The following code which is an adaptation of how I'd do the same thing with a synchronous iterable doesn't work, since <code>yield</code> isn't allowed inside <code>async def</code>s.</p>

<pre><code>async def mapfilter(aiterable, p, func):
    async for payload in aiterable:
        if p(payload):

            # This part isn't allowed, but hopefully it should be clear
            # what I'm trying to accomplish.
            yield func(payload)
</code></pre>
