This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jan.cespivo
Recipients Dima.Tisnek, chris.jerdonek, emilyemorehouse, jan.cespivo, yselivanov
Date 2018-05-24.11:49:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've reproduced the problem also in 3.7 branch.

import asyncio

loop = asyncio.get_event_loop()

async def consumer():
    while True:
        await asyncio.sleep(0)
        message = yield
        print('received', message)

async def amain():
    agenerator = consumer()
    await agenerator.asend(None)

    fa = asyncio.create_task(agenerator.asend('A'))
    fb = asyncio.create_task(agenerator.asend('B'))
    await fa
    await fb


received A
received None

If the line `await asyncio.sleep(0)` is omitted the output is ok:
received A
received B
Date User Action Args
2018-05-24 11:49:24jan.cespivosetrecipients: + jan.cespivo, chris.jerdonek, Dima.Tisnek, yselivanov, emilyemorehouse
2018-05-24 11:49:24jan.cespivosetmessageid: <>
2018-05-24 11:49:24jan.cespivolinkissue30773 messages
2018-05-24 11:49:24jan.cespivocreate