New submission from Paolo Lammens <lammenspa...@gmail.com>:

The `inspect.iscoroutinefunction` and `inspect.iscoroutine` functions return 
`False` for the `asend`, `athrow` and `aclose` methods of asynchronous 
generators (PEP 525). These are coroutine functions (i.e. one does e.g. `await 
gen.asend(value)`) so I would have expected these to return `True`.

Example:

```python
async def generator():
    return
    yield
```

```python
>>> import inspect
>>> g = generator()
>>> inspect.iscoroutinefunction(g.asend)
False

>>> inspect.iscoroutine(g.asend(None))
False
```

----------
components: Library (Lib), asyncio
messages: 383862
nosy: asvetlov, plammens, yselivanov
priority: normal
severity: normal
status: open
title: inspect.iscoroutine returns False for asynchronous generator functions
type: behavior

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

Reply via email to