Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18321)

Unified Diff: Lib/inspect.py

Issue 20691: inspect.signature: Consider exposing 'follow_wrapper_chains' option in public API
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Doc/library/inspect.rst ('k') | Lib/test/test_inspect.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/inspect.py Tue May 19 21:06:04 2015 +0200
+++ b/Lib/inspect.py Tue May 19 17:17:09 2015 -0400
@@ -2664,9 +2664,10 @@
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 @@
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():
« no previous file with comments | « Doc/library/inspect.rst ('k') | Lib/test/test_inspect.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+