diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-01 04:04:41 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-01 04:04:41 +0000 |
commit | 6060d5e3fad5bb278b0516430cacf4b51536ecad (patch) | |
tree | 12b5cded3b94ebdac856ab7006076d86f61cf3b6 /Lib/inspect.py | |
parent | 8ad09a4f2e557723395fc0840750c178924166b8 (diff) | |
download | cpython-git-6060d5e3fad5bb278b0516430cacf4b51536ecad.tar.gz |
simplfy code
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 230df2b2a7..1685bfc98d 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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. |