Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.
inspect/isgeneratorfunction
isgeneratorfunction