gh-113942: Show functions implemented as builtin methods (GH-115306)

Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.
This commit is contained in:
Serhiy Storchaka 2024-02-26 20:29:49 +02:00 committed by GitHub
parent 68c79d21fa
commit 72cff8d8e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 6 deletions

View file

@ -855,9 +855,9 @@ class HTMLDoc(Doc):
cdict[key] = cdict[base] = modname + '.html#' + key
funcs, fdict = [], {}
for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
inspect.isbuiltin(value) or inspect.getmodule(value) is object):
# if __all__ exists, believe it. Otherwise use a heuristic.
if (all is not None
or (inspect.getmodule(value) or object) is object):
if visiblename(key, all, object):
funcs.append((key, value))
fdict[key] = '#-' + key
@ -1299,9 +1299,9 @@ location listed above.
classes.append((key, value))
funcs = []
for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
inspect.isbuiltin(value) or inspect.getmodule(value) is object):
# if __all__ exists, believe it. Otherwise use a heuristic.
if (all is not None
or (inspect.getmodule(value) or object) is object):
if visiblename(key, all, object):
funcs.append((key, value))
data = []