On Fri, Jun 3, 2016 at 9:14 PM, Nathaniel Smith <njs@pobox.com> wrote:
On Fri, Jun 3, 2016 at 6:10 PM, Ben Darnell <ben@bendarnell.com> wrote:
> The introduction of `await` has imposed similar restrictions on both
> systems, so there is no more yielding of lists or dicts in either case;
> explicit wrapper objects must be used. (but there's still a difference in
> that asyncio.Task allows None but tornado coroutines do not)

I'm not saying that yielding lists or dicts is useful, but it sounds
like you're saying that somehow it's actually incompatible with
async/await, and I don't understand why that would be -- e.g., this
works fine?:

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. 
 

In [2]: @types.coroutine
   ...: def yield_list():
   ...:     yield [1, 2, 3]
   ...:

In [3]: async def f():
   ...:     await yield_list()
   ...:

In [4]: next(f().__await__())
Out[4]: [1, 2, 3]

-n

--
Nathaniel J. Smith -- https://vorpus.org