Message383862
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
``` |
|
Date |
User |
Action |
Args |
2020-12-27 20:41:27 | plammens | set | recipients:
+ plammens, asvetlov, yselivanov |
2020-12-27 20:41:27 | plammens | set | messageid: <1609101687.37.0.151159530312.issue42760@roundup.psfhosted.org> |
2020-12-27 20:41:27 | plammens | link | issue42760 messages |
2020-12-27 20:41:27 | plammens | create | |
|