Kaydet (Commit) 1d241835 authored tarafından Yury Selivanov's avatar Yury Selivanov

inspect.signature: Use 'inspect.isbuiltin' in 'Signature.from_builtin'

üst 900aeb72
......@@ -1594,8 +1594,9 @@ def _signature_bound_method(sig):
def _signature_is_builtin(obj):
# Internal helper to test if `obj` is a callable that might
# support Argument Clinic's __text_signature__ protocol.
return (isinstance(obj, _NonUserDefinedCallables) or
return (isbuiltin(obj) or
ismethoddescriptor(obj) or
isinstance(obj, _NonUserDefinedCallables) or
# Can't test 'isinstance(type)' here, as it would
# also be True for regular python classes
obj in (type, object))
......
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