classification
Title: Pydoc allmethods does not return all methods
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Matt.Bachmann, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2013-03-19 04:24 by Matt.Bachmann, last changed 2013-03-19 06:51 by r.david.murray. This issue is now closed.

Files
File name Uploaded Description Edit
fix_is_some_method.patch Matt.Bachmann, 2013-03-19 04:51 Fix for _is_some_method in pydoc with associated test review
Messages (5)
msg184590 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-19 04:24
Somewhere between python 2.7 and now the definition of a method changed causing this helper method in pydoc to break. This was discovered in http://bugs.python.org/issue17464 by r.david.murray when he found it curious that a test I wrote was passing. I had assumed the implemented behavior was correct.

Attached is a patch that ads in an updated version of that test with a fix to the bug. The method updated is only used in that one place as is indicated as private. So it only gets in classes. I went ahead and updated the param to reflect this.
msg184593 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-03-19 04:48
Looks like you uploaded the wrong patch file.

Additional note: while pydoc itself does not use the allmethods method (which is doubtless why the bug wasn't found previously), I found through google that numpy at least uses it.  So it does need to be fixed.
msg184595 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-19 04:51
Yes! Sorry.
msg184603 - (view) Author: Roundup Robot (python-dev) Date: 2013-03-19 06:48
New changeset 0a9b42de49d5 by R David Murray in branch '3.2':
#17476: make allmethods actually return all methods.
http://hg.python.org/cpython/rev/0a9b42de49d5

New changeset 7127fbc363bb by R David Murray in branch '3.3':
#17476: make allmethods actually return all methods.
http://hg.python.org/cpython/rev/7127fbc363bb

New changeset ee1376c15e2e by R David Murray in branch 'default':
Merge: #17476: make allmethods actually return all methods.
http://hg.python.org/cpython/rev/ee1376c15e2e
msg184604 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-03-19 06:51
Thanks, Matt.

I figured out a way to make the test *somewhat* less fragile.

Oh, and that helper method really is operating on an object, not a class, so I changed the paramter name back (and added inspect.builtin...which Python2 didn't have, but I figure as long as we are fixing it we might as well fix it to get *all* the methods).
History
Date User Action Args
2013-03-19 06:51:10r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg184604

stage: resolved
2013-03-19 06:48:01python-devsetnosy: + python-dev
messages: + msg184603
2013-03-19 04:51:52Matt.Bachmannsetfiles: - pydoc_tests_v3.patch
2013-03-19 04:51:33Matt.Bachmannsetfiles: + fix_is_some_method.patch

messages: + msg184595
2013-03-19 04:48:40r.david.murraysettype: behavior
messages: + msg184593
versions: + Python 3.2, Python 3.3, Python 3.4, - Python 3.5
2013-03-19 04:24:08Matt.Bachmanncreate