]> granicus.if.org Git - python/commitdiff
simplfy code
authorBenjamin Peterson <benjamin@python.org>
Thu, 1 Jan 2009 04:04:41 +0000 (04:04 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 1 Jan 2009 04:04:41 +0000 (04:04 +0000)
Lib/inspect.py

index 230df2b2a75e878d0f00c6351c86c6e908a77637..1685bfc98d415d799f7ab3b421b4991439a48bfc 100644 (file)
@@ -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.