[issue34802] asyncio.iscoroutine() documentation is wrong

Gefn report at bugs.python.org
Tue Sep 25 16:32:06 EDT 2018


New submission from Gefn <insomgla at gmail.com>:

The documentation states that "This method is different from inspect.iscoroutine() because it returns True for generator-based coroutines decorated with @coroutine."

It seems to be wrong, a method written as follow:

def test(): yield 1

will be evaluated as a coroutine by asyncio.iscoroutine(), even if not decorated. The old doc stated "Return True if obj is a coroutine object, which may be based on a generator or an async def coroutine.", which seems more correct.

----------
messages: 326404
nosy: Gefn
priority: normal
severity: normal
status: open
title: asyncio.iscoroutine() documentation is wrong
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34802>
_______________________________________


More information about the Python-bugs-list mailing list