]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clean up isroutine().
authorKa-Ping Yee <ping@zesty.ca>
Fri, 13 Apr 2001 14:04:02 +0000 (14:04 +0000)
committerKa-Ping Yee <ping@zesty.ca>
Fri, 13 Apr 2001 14:04:02 +0000 (14:04 +0000)
Lib/inspect.py

index c358a5c57e77b315740e600f2f6312ec7f4d275c..2d88bc1f6429f37a4df094a2caca142ed48f94cf 100644 (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.