<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 3, 2016 at 9:14 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jun 3, 2016 at 6:10 PM, Ben Darnell <<a href="mailto:ben@bendarnell.com">ben@bendarnell.com</a>> wrote:<br>
> The introduction of `await` has imposed similar restrictions on both<br>
> systems, so there is no more yielding of lists or dicts in either case;<br>
> explicit wrapper objects must be used. (but there's still a difference in<br>
> that asyncio.Task allows None but tornado coroutines do not)<br>
<br>
</span>I'm not saying that yielding lists or dicts is useful, but it sounds<br>
like you're saying that somehow it's actually incompatible with<br>
async/await, and I don't understand why that would be -- e.g., this<br>
works fine?:<br></blockquote><div><br></div><div>Yes, this works fine as long as you have the extra hop into a decorated coroutine. What you can't do is `await [1, 2, 3]` in an `async def` native coroutine. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In [2]: @types.coroutine<br>
   ...: def yield_list():<br>
   ...:     yield [1, 2, 3]<br>
   ...:<br>
<br>
In [3]: async def f():<br>
   ...:     await yield_list()<br>
   ...:<br>
<br>
In [4]: next(f().__await__())<br>
Out[4]: [1, 2, 3]<br>
<div class="HOEnZb"><div class="h5"><br>
-n<br>
<br>
--<br>
Nathaniel J. Smith -- <a href="https://vorpus.org" rel="noreferrer" target="_blank">https://vorpus.org</a><br>
</div></div></blockquote></div><br></div></div>