From: Ka-Ping Yee Date: Fri, 13 Apr 2001 14:04:02 +0000 (+0000) Subject: Clean up isroutine(). X-Git-Tag: v2.1c1~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=022171fa2195e5958d678605457b0f8741dd901d;p=thirdparty%2FPython%2Fcpython.git Clean up isroutine(). --- diff --git a/Lib/inspect.py b/Lib/inspect.py index c358a5c57e77..2d88bc1f6429 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -127,8 +127,7 @@ def isbuiltin(object): def isroutine(object): """Return true if the object is any kind of function or method.""" - return type(object) in [types.FunctionType, types.LambdaType, - types.MethodType, types.BuiltinFunctionType] + return isbuiltin(object) or isfunction(object) or ismethod(object) def getmembers(object, predicate=None): """Return all members of an object as (name, value) pairs sorted by name.