mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #20189: Four additional builtin types (PyTypeObject,
PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
This commit is contained in:
parent
b3c0f4067d
commit
5c66189e88
31 changed files with 851 additions and 508 deletions
13
Lib/pydoc.py
13
Lib/pydoc.py
|
@ -925,7 +925,10 @@ class HTMLDoc(Doc):
|
|||
anchor, name, reallink)
|
||||
argspec = None
|
||||
if inspect.isfunction(object) or inspect.isbuiltin(object):
|
||||
signature = inspect.signature(object)
|
||||
try:
|
||||
signature = inspect.signature(object)
|
||||
except (ValueError, TypeError):
|
||||
signature = None
|
||||
if signature:
|
||||
argspec = str(signature)
|
||||
if realname == '<lambda>':
|
||||
|
@ -1319,8 +1322,12 @@ location listed above.
|
|||
skipdocs = 1
|
||||
title = self.bold(name) + ' = ' + realname
|
||||
argspec = None
|
||||
if inspect.isfunction(object) or inspect.isbuiltin(object):
|
||||
signature = inspect.signature(object)
|
||||
|
||||
if inspect.isroutine(object):
|
||||
try:
|
||||
signature = inspect.signature(object)
|
||||
except (ValueError, TypeError):
|
||||
signature = None
|
||||
if signature:
|
||||
argspec = str(signature)
|
||||
if realname == '<lambda>':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue