Kaydet (Commit) 022171fa authored tarafından Ka-Ping Yee's avatar Ka-Ping Yee

Clean up isroutine().

üst 9bc576b7
...@@ -127,8 +127,7 @@ def isbuiltin(object): ...@@ -127,8 +127,7 @@ def isbuiltin(object):
def isroutine(object): def isroutine(object):
"""Return true if the object is any kind of function or method.""" """Return true if the object is any kind of function or method."""
return type(object) in [types.FunctionType, types.LambdaType, return isbuiltin(object) or isfunction(object) or ismethod(object)
types.MethodType, types.BuiltinFunctionType]
def getmembers(object, predicate=None): def getmembers(object, predicate=None):
"""Return all members of an object as (name, value) pairs sorted by name. """Return all members of an object as (name, value) pairs sorted by name.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment