From: Benjamin Peterson Date: Thu, 1 Jan 2009 04:04:41 +0000 (+0000) Subject: simplfy code X-Git-Tag: v2.7a1~2452 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6060d5e3fad5bb278b0516430cacf4b51536ecad;p=thirdparty%2FPython%2Fcpython.git simplfy code --- diff --git a/Lib/inspect.py b/Lib/inspect.py index 230df2b2a75e..1685bfc98d41 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.