mirror of
https://github.com/python/cpython.git
synced 2025-10-22 17:33:55 +00:00
[3.14] gh-139076: Fix regression in pydoc not showing extension functions (GH-139077) (GH-139160)
Fix a bug in the pydoc module that was hiding functions in a Python
module if they were implemented in an extension module and the module did
not have __all__.
(cherry picked from commit 7257b24140
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
b53f46a7b7
commit
103766528f
4 changed files with 21 additions and 0 deletions
|
@ -884,6 +884,7 @@ def docmodule(self, object, name=None, mod=None, *ignored):
|
|||
for key, value in inspect.getmembers(object, inspect.isroutine):
|
||||
# if __all__ exists, believe it. Otherwise use a heuristic.
|
||||
if (all is not None
|
||||
or inspect.isbuiltin(value)
|
||||
or (inspect.getmodule(value) or object) is object):
|
||||
if visiblename(key, all, object):
|
||||
funcs.append((key, value))
|
||||
|
@ -1328,6 +1329,7 @@ def docmodule(self, object, name=None, mod=None, *ignored):
|
|||
for key, value in inspect.getmembers(object, inspect.isroutine):
|
||||
# if __all__ exists, believe it. Otherwise use a heuristic.
|
||||
if (all is not None
|
||||
or inspect.isbuiltin(value)
|
||||
or (inspect.getmodule(value) or object) is object):
|
||||
if visiblename(key, all, object):
|
||||
funcs.append((key, value))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue