diff options
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 3b58bd8..da55ac6 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -158,9 +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.__code__.co_flags & CO_GENERATOR: - return True + return bool((isfunction(object) or ismethod(object)) and + object.__code__.co_flags & CO_GENERATOR) def isgenerator(object): """Return true if the object is a generator. |