diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-02 17:51:20 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-02 17:51:20 (GMT) |
commit | 1d2418355016d0c4ce2e3a3c58516062ea14785d (patch) | |
tree | ddafab2c6e52fb0e5b2251c1dd93f33290308dd5 | |
parent | 900aeb722112da02d0ae3d7087115f500db4408b (diff) | |
download | cpython-1d2418355016d0c4ce2e3a3c58516062ea14785d.zip cpython-1d2418355016d0c4ce2e3a3c58516062ea14785d.tar.gz cpython-1d2418355016d0c4ce2e3a3c58516062ea14785d.tar.bz2 |
inspect.signature: Use 'inspect.isbuiltin' in 'Signature.from_builtin'
-rw-r--r-- | Lib/inspect.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index a65aafd..4e33a22 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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)) |