Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 022171f

Browse files
committed
Clean up isroutine().
1 parent 9bc576b commit 022171f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/inspect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ def isbuiltin(object):
127127

128128
def isroutine(object):
129129
"""Return true if the object is any kind of function or method."""
130-
return type(object) in [types.FunctionType, types.LambdaType,
131-
types.MethodType, types.BuiltinFunctionType]
130+
return isbuiltin(object) or isfunction(object) or ismethod(object)
132131

133132
def getmembers(object, predicate=None):
134133
"""Return all members of an object as (name, value) pairs sorted by name.

0 commit comments

Comments
 (0)