diff options
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index fefcddb..f0c1247 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1530,9 +1530,6 @@ def signature(obj): if not callable(obj): raise TypeError('{!r} is not a callable object'.format(obj)) - if _signature_is_builtin(obj): - return Signature.from_builtin(obj) - if isinstance(obj, types.MethodType): # In this case we skip the first parameter of the underlying # function (usually `self` or `cls`). @@ -1570,6 +1567,9 @@ def signature(obj): return sig.replace(parameters=new_params) + if _signature_is_builtin(obj): + return Signature.from_builtin(obj) + if isinstance(obj, types.FunctionType): return Signature.from_function(obj) |