From 5f56bbb798b5413e3c06db5f08852f40f4da6121 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Tue, 19 Mar 2013 02:47:44 -0400 Subject: 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. --- Lib/pydoc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lib/pydoc.py') 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 = {} -- cgit v1.2.1