diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-03-19 06:31:06 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-03-19 06:31:06 (GMT) |
commit | 9929bc543a014f3c7f764d79a614fc8a9751d7ce (patch) | |
tree | 52691986335069ed61c500bfb42f96de8e140a8d /Lib/pydoc.py | |
parent | a846f5ace80977f922e8295441afc668910fc894 (diff) | |
download | cpython-9929bc543a014f3c7f764d79a614fc8a9751d7ce.zip cpython-9929bc543a014f3c7f764d79a614fc8a9751d7ce.tar.gz cpython-9929bc543a014f3c7f764d79a614fc8a9751d7ce.tar.bz2 |
#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-x | Lib/pydoc.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 37616fb..fa02eda 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -137,7 +137,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 = {} |