summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-19 02:47:44 -0400
committerR David Murray <rdmurray@bitdance.com>2013-03-19 02:47:44 -0400
commit5f56bbb798b5413e3c06db5f08852f40f4da6121 (patch)
tree2fc489357e8eb4bbc1c6526054c3a042d96676af /Lib/pydoc.py
parent862cca369c640a091c5ce62d4b84913d92cb2c4c (diff)
downloadcpython-5f56bbb798b5413e3c06db5f08852f40f4da6121.tar.gz
Merge: #17476: make allmethods actually return all methods.
This fixes a regression relative to Python2. (In 2, methods on a class were unbound methods and matched the inspect queries being done, in 3 they are just functions and so were missed). This is an undocumented function that pydoc itself does not use, but I found that numpy at least uses it in its documentation generator. Original patch by Matt Bachmann.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 292aa46015..4d681b0efa 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -132,7 +132,10 @@ def stripid(text):
return _re_stripid.sub(r'\1', text)
def _is_some_method(obj):
- return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)
+ return (inspect.isfunction(obj) or
+ inspect.ismethod(obj) or
+ inspect.isbuiltin(obj) or
+ inspect.ismethoddescriptor(obj))
def allmethods(cl):
methods = {}