[Python-checkins] cpython: inspect.signature: Use 'inspect.isbuiltin' in 'Signature.from_builtin'

yury.selivanov python-checkins at python.org
Sun Feb 2 18:51:35 CET 2014


http://hg.python.org/cpython/rev/48c3c42e3e5c
changeset:   88897:48c3c42e3e5c
user:        Yury Selivanov <yselivanov at sprymix.com>
date:        Sun Feb 02 12:51:20 2014 -0500
summary:
  inspect.signature: Use 'inspect.isbuiltin' in 'Signature.from_builtin'

files:
  Lib/inspect.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/inspect.py b/Lib/inspect.py
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1594,8 +1594,9 @@
 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))

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list