We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab422f7 commit 8c6429eCopy full SHA for 8c6429e
Lib/inspect.py
@@ -396,7 +396,9 @@ def iscoroutinefunction(obj):
396
397
Coroutine functions are defined with "async def" syntax.
398
"""
399
- return _has_code_flag(obj, CO_COROUTINE)
+ return _has_code_flag(obj, CO_COROUTINE) or (
400
+ callable(obj) and _has_code_flag(obj.__call__, CO_COROUTINE)
401
+ )
402
403
def isasyncgenfunction(obj):
404
"""Return true if the object is an asynchronous generator function.
0 commit comments