[Python-checkins] r68115 - python/trunk/Lib/inspect.py

benjamin.peterson python-checkins at python.org
Thu Jan 1 05:04:42 CET 2009


Author: benjamin.peterson
Date: Thu Jan  1 05:04:41 2009
New Revision: 68115

Log:
simplfy code

Modified:
   python/trunk/Lib/inspect.py

Modified: python/trunk/Lib/inspect.py
==============================================================================
--- python/trunk/Lib/inspect.py	(original)
+++ python/trunk/Lib/inspect.py	Thu Jan  1 05:04:41 2009
@@ -158,10 +158,8 @@
     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.


More information about the Python-checkins mailing list