summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-19 06:47:44 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-03-19 06:47:44 (GMT)
commitac0cea5fab2350aa5f7001a8c524f93c540f0b44 (patch)
treeb5a2c921c5c1a7a7c507a15c4834f05d690c1187 /Lib/pydoc.py
parent3a61943b7bd9031293aa03b6505cb29d5630abfa (diff)
downloadcpython-ac0cea5fab2350aa5f7001a8c524f93c540f0b44.zip
cpython-ac0cea5fab2350aa5f7001a8c524f93c540f0b44.tar.gz
cpython-ac0cea5fab2350aa5f7001a8c524f93c540f0b44.tar.bz2
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 292aa46..4d681b0 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 = {}