mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
#4795 inspect.isgeneratorfunction() should return False instead of None
This commit is contained in:
parent
3cda1db67f
commit
8ad09a4f2e
2 changed files with 4 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue