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 skrech
Recipients asvetlov, skrech, yselivanov
Date 2022-02-21.17:23:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645464186.16.0.0687451065828.issue46818@roundup.psfhosted.org>
In-reply-to
Content
Hello Andrew, 

I'm sorry for using the bug tracker, but I wasn't sure whether posting on StackOverflow (is this the appropriate Q&A site?) will attract the attention of the right people.

Although I see you marked this as Closed, I'll be very pleased if you'd elaborate on why I don't need send/throw/close methods since they are "mandatory" from collections.abc.Coroutine. Are you suggesting that I need to just inherit from Awaitable? 

As a matter of fact, I'm writing in the bug tracker because I think that there is a potential for a change -- maybe just in the documentation. I struggle to find an example on how to implement a Coroutine class, and I believe this will be valuable to others, too. While reading the documentation of collections.abc.Coroutine one have an impression that he/she would have to return an Iterator from __await__() and then outer coroutines will call send/throw/close methods of the derived collections.abc.Coroutine class, but this is not the case. One have to dive deep into Python internals to grasp why Iterator should be returned and how outer coroutines interact with it.

Moreover, there are several cross-referencing PEPs that explain yield, yield from, await but none of them has an example of how to construct a Coroutine from a class. Explanation and examples are always concerned with `yield` and its suspension property is presented as implementation detail.
History
Date User Action Args
2022-02-21 17:23:06skrechsetrecipients: + skrech, asvetlov, yselivanov
2022-02-21 17:23:06skrechsetmessageid: <1645464186.16.0.0687451065828.issue46818@roundup.psfhosted.org>
2022-02-21 17:23:06skrechlinkissue46818 messages
2022-02-21 17:23:05skrechcreate