Python Asynchronous Comprehensions - how do they work? : <p>I'm having trouble understanding the use of asynchronous comprehensions introduced in Python 3.6. As a disclaimer, I don't have a lot of experience dealing with asynchronous code in general in Python.</p>

<p>The example given in the <a href="https://docs.python.org/3/whatsnew/3.6.html" rel="noreferrer">what's new for Python 3.6</a> document is:</p>

<pre><code>result = [i async for i in aiter() if i % 2]
</code></pre>

<p>In the <a href="https://www.python.org/dev/peps/pep-0530/" rel="noreferrer">PEP</a>, this is expanded to:</p>

<pre><code>result = []
async for i in aiter():
    if i % 2:
        result.append(i)
</code></pre>

<p>I <em>think</em> I understand that the <code>aiter()</code> function gets called asynchronously, so that each iteration of <code>aiter</code> can proceed without the previous one necessarily returning yet (or is this understanding wrong?).</p>

<p>What I'm not sure about is how that then translates to the list comprehension here. Do results get placed into the list in the order that they are returned? Or are there effective 'placeholders' in the final list so that each result is placed in the list in the right order? Or am I thinking about this the wrong way?</p>

<p>Additionally, is someone able to provide a real-world example that would illustrate both an applicable use case and the basic mechanics of <code>async</code> in comprehensions like this?</p>
