New submission from Hrvoje Nikšić <hnik...@gmail.com>:

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

----------
assignee: docs@python
components: Documentation
messages: 324157
nosy: docs@python, hniksic
priority: normal
severity: normal
status: open
title: Documentation for coroutine objects
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34518>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to