Return True if func is a coroutine function (a function defined with async def syntax, and doesn't contain yield), or a function decorated with @asyncio.coroutine. Note: copied and modified from Python 3.5's builtin couroutines.py to avoid importing asyncio directly, which in turns
(func: object)
| 66 | |
| 67 | |
| 68 | def iscoroutinefunction(func: object) -> bool: |
| 69 | """Return True if func is a coroutine function (a function defined with async |
| 70 | def syntax, and doesn't contain yield), or a function decorated with |
| 71 | @asyncio.coroutine. |
| 72 | |
| 73 | Note: copied and modified from Python 3.5's builtin couroutines.py to avoid |
| 74 | importing asyncio directly, which in turns also initializes the "logging" |
| 75 | module as a side-effect (see issue #8). |
| 76 | """ |
| 77 | return inspect.iscoroutinefunction(func) or getattr(func, "_is_coroutine", False) |
| 78 | |
| 79 | |
| 80 | def is_async_function(func: object) -> bool: |
no outgoing calls
no test coverage detected