diff options
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 13d0c7bc5c..9ad55a90bc 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2664,9 +2664,10 @@ class Signature: return _signature_from_builtin(cls, func) @classmethod - def from_callable(cls, obj): + def from_callable(cls, obj, *, follow_wrapped=True): """Constructs Signature for the given callable object.""" - return _signature_from_callable(obj, sigcls=cls) + return _signature_from_callable(obj, sigcls=cls, + follow_wrapper_chains=follow_wrapped) @property def parameters(self): @@ -2915,9 +2916,9 @@ class Signature: return rendered -def signature(obj): +def signature(obj, *, follow_wrapped=True): """Get a signature object for the passed callable.""" - return Signature.from_callable(obj) + return Signature.from_callable(obj, follow_wrapped=follow_wrapped) def _main(): |