Also what I found with a web search is that this is exactly what
Code: Select all
MethodType
Code: Select all
MethodType
Code: Select all
from inspect import iscoroutine
Code: Select all
def iscoroutine(obj):
return str(type(obj)) == "<class 'generator'>"