Return true if the object is a coroutine function. Coroutine functions are normally defined with "async def" syntax, but may be marked via markcoroutinefunction.
(obj)
| 321 | return func |
| 322 | |
| 323 | def iscoroutinefunction(obj): |
| 324 | """Return true if the object is a coroutine function. |
| 325 | |
| 326 | Coroutine functions are normally defined with "async def" syntax, but may |
| 327 | be marked via markcoroutinefunction. |
| 328 | """ |
| 329 | return _has_code_flag(obj, CO_COROUTINE) or _has_coroutine_mark(obj) |
| 330 | |
| 331 | def isasyncgenfunction(obj): |
| 332 | """Return true if the object is an asynchronous generator function. |
searching dependent graphs…