I suspect this has something to do with the differences b/w yield from & await.
However, & aside from the new object's designation as an async_generator, I'm unclear about consequences regarding the differences between it and a coroutine.
(I'm not sure how else to ask the question other than the one I put in the title...)
import asyncio
async def async_generator_spits_out_letters():
yield 'a'
yield 'b'
yield 'c'
yield 'd'
await asyncio.sleep(0)
async def coroutine_prints_messages():
while True:
print('hi')
await asyncio.sleep(2)
def test_it():
print(type(async_generator_spits_out_letters))
print(type(coroutine_prints_messages))
# This is how I choose to do newlines....it's easier for me to read. :[
print(); print()
print(type(async_generator_spits_out_letters()))
print(type(coroutine_prints_messages()))
This gives:
<class 'async_generator'>
<class 'coroutine'>
<class 'function'>
<class 'function'>
I can't make heads or tails of this...
yields, a coroutine does not.