the yield return a collections.Iterable but many types are also iterable
def aaaa():
yield 1
yield 2
yield 3
d = aaaa()
print(d,type(d),isinstance(d, collections.Iterable))
the print type
<generator object aaaa at 0x0000000002626B88> <class 'generator'> True
i didn’t find the class ‘generator’ or i can’t do typecheck.
If you want to check if the iterable is a generator object:
If you want to check if the function contains
yieldstatements (i.e. the function is a generator):