From 022171fa2195e5958d678605457b0f8741dd901d Mon Sep 17 00:00:00 2001 From: Ka-Ping Yee Date: Fri, 13 Apr 2001 14:04:02 +0000 Subject: Clean up isroutine(). --- Lib/inspect.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index c358a5c..2d88bc1 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. -- cgit v0.12