Clean up isroutine().

This commit is contained in:
Ka-Ping Yee 2001-04-13 14:04:02 +00:00
parent 9bc576b7f6
commit 022171fa21
1 changed files with 1 additions and 2 deletions

View File

@ -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.