simplfy code

This commit is contained in:
Benjamin Peterson 2009-01-01 04:04:41 +00:00
parent 8ad09a4f2e
commit 6060d5e3fa

View file

@ -158,10 +158,8 @@ def isgeneratorfunction(object):
Generator function objects provides same attributes as functions. Generator function objects provides same attributes as functions.
See isfunction.__doc__ for attributes listing.""" See isfunction.__doc__ for attributes listing."""
if (isfunction(object) or ismethod(object)) and \ return bool((isfunction(object) or ismethod(object)) and
object.func_code.co_flags & CO_GENERATOR: object.func_code.co_flags & CO_GENERATOR)
return True
return False
def isgenerator(object): def isgenerator(object):
"""Return true if the object is a generator. """Return true if the object is a generator.