summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-02-26 18:29:49 (GMT)
committerGitHub <noreply@github.com>2024-02-26 18:29:49 (GMT)
commit72cff8d8e5a476d3406efb0491452bf9d6b02feb (patch)
tree401a6020466917aa98fb0ade7e0d0686ea2c7702 /Lib/pydoc.py
parent68c79d21fa791d7418a858b7aa4604880e988a02 (diff)
downloadcpython-72cff8d8e5a476d3406efb0491452bf9d6b02feb.zip
cpython-72cff8d8e5a476d3406efb0491452bf9d6b02feb.tar.gz
cpython-72cff8d8e5a476d3406efb0491452bf9d6b02feb.tar.bz2
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.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index d32fa8d..b0193b4 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -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 = []