mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
simplfy code
This commit is contained in:
parent
8ad09a4f2e
commit
6060d5e3fa
1 changed files with 2 additions and 4 deletions
|
|
@ -158,10 +158,8 @@ def isgeneratorfunction(object):
|
|||
Generator function objects provides same attributes as functions.
|
||||
|
||||
See isfunction.__doc__ for attributes listing."""
|
||||
if (isfunction(object) or ismethod(object)) and \
|
||||
object.func_code.co_flags & CO_GENERATOR:
|
||||
return True
|
||||
return False
|
||||
return bool((isfunction(object) or ismethod(object)) and
|
||||
object.func_code.co_flags & CO_GENERATOR)
|
||||
|
||||
def isgenerator(object):
|
||||
"""Return true if the object is a generator.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue