(obj)
Return True if obj is a coroutine object.
Return True if obj is a coroutine object.
Return True if obj is a coroutine object .
def iscoroutine(obj):
    """Return True if obj is a coroutine object."""
    if type(obj) in _iscoroutine_typecache:
        return True

    if isinstance(obj, _COROUTINE_TYPES):
        # Just in case we don't want to cache more than 100
        # positive types.  That shouldn't ever happen, unless
        # someone stressing the system on purpose.
        if len(_iscoroutine_typecache) < 100:
            _iscoroutine_typecache.add(type(obj))
        return True
    else:
        return False
def iscoroutine ( obj ) : if type ( obj ) in _iscoroutine_typecache : return True if isinstance ( obj , _COROUTINE_TYPES ) : # Just in case we don't want to cache more than 100 # positive types.  That shouldn't ever happen, unless # someone stressing the system on purpose. if len ( _iscoroutine_typecache ) < 100 : _iscoroutine_typecache . add ( type ( obj ) ) return True else : return False