#4795 inspect.isgeneratorfunction() should return False instead of None

This commit is contained in:
Benjamin Peterson 2008-12-31 23:48:39 +00:00
parent 3cda1db67f
commit 8ad09a4f2e
2 changed files with 4 additions and 0 deletions

View file

@ -161,6 +161,7 @@ def isgeneratorfunction(object):
if (isfunction(object) or ismethod(object)) and \
object.func_code.co_flags & CO_GENERATOR:
return True
return False
def isgenerator(object):
"""Return true if the object is a generator.