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 hniksic
Recipients docs@python, hniksic
Date 2018-08-27.08:44:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1535359488.51.0.56676864532.issue34518@psf.upfronthosting.co.za>
In-reply-to
Content
Coroutine objects have public methods such as send, close, and throw, which do not appear to be documented. For example, at https://stackoverflow.com/q/51975658/1600898 a StackOverflow user asks how to abort an already created (but not submitted) coroutine without a RuntimeWarning, with the answer being to use the close() method. The user asked where does one find the close method.

Currently methods only appear to be documented in PEP 492, referring to generator documentation for details. The glossary entry for coroutine (object) links to PEP 492 and to the async def statement. Various places in the documentation, e.g. the index, link to https://docs.python.org/3/library/asyncio-task.html#coroutine but that page is mostly concerned with the usage of coroutines within asyncio, where the methods on individual coroutine objects should not be used.

I would expect to find documentation on coroutine objects under built-in types, https://docs.python.org/3/library/stdtypes.html .

In comparison, generator-iterator methods are documented in the language reference:

https://docs.python.org/3/reference/expressions.html#generator-iterator-methods
History
Date User Action Args
2018-08-27 08:44:48hniksicsetrecipients: + hniksic, docs@python
2018-08-27 08:44:48hniksicsetmessageid: <1535359488.51.0.56676864532.issue34518@psf.upfronthosting.co.za>
2018-08-27 08:44:48hniksiclinkissue34518 messages
2018-08-27 08:44:48hniksiccreate