(object)
return bool((isfunction(object) or ismethod(object)) and
                object.__code__.co_flags & CO_GENERATOR)
Return true if the object is a user-defined generator function.

    Generator function objects provides same attributes as functions.

    See help(isfunction) for attributes listing.
Return true if the object is a user-defined generator function.
Return true if the object is a user - defined generator function .
def isgeneratorfunction(object):
    """Return true if the object is a user-defined generator function.

    Generator function objects provides same attributes as functions.

    See help(isfunction) for attributes listing."""
    return bool((isfunction(object) or ismethod(object)) and
                object.__code__.co_flags & CO_GENERATOR)
def isgeneratorfunction ( object ) : return bool ( ( isfunction ( object ) or ismethod ( object ) ) and object . __code__ . co_flags & CO_GENERATOR )