[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Charles-François Natali added the comment: Berker, I've committed your patch, thanks! -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Berker Peksag added the comment: I guess the tests --without-doc-strings are broken: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/6900/steps/test/logs/stdio Attached patch fixes these failures. -- nosy: +berker.peksag versions: +Python 3.5 -Python 3.2, Python 3.3 Added file: http://bugs.python.org/file35695/issue13223_tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Stefan Krah added the comment: I guess the tests --without-doc-strings are broken: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/6900/steps/test/logs/stdio -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Skyler Leigh Amador added the comment: The patch still applies cleanly, so I've just updated the comment. test passes, make patchcheck passes. -- nosy: +shiinee Added file: http://bugs.python.org/file35525/pydoc-self.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Roundup Robot added the comment: New changeset 7aa72075d440 by Benjamin Peterson in branch '3.4': don't remove self from example code in the HTML output (closes #13223) http://hg.python.org/cpython/rev/7aa72075d440 New changeset e89c39125892 by Benjamin Peterson in branch '2.7': don't remove self from example code in the HTML output (closes #13223) http://hg.python.org/cpython/rev/e89c39125892 New changeset cddb17c4975e by Benjamin Peterson in branch 'default': merge 3.4 (#13223) http://hg.python.org/cpython/rev/cddb17c4975e -- nosy: +python-dev resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Ezio Melotti added the comment: Víctor, can you address my comment on rietveld? -- versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Éric Araujo mer...@netwok.org added the comment: Patch looks good to me. Ezio, do you have time to review too? (I had forgotten that there were tests checking the exact HTML output. This won’t be fun when we overhaul pydoc to make it generate sensible HTML.) -- nosy: +eric.araujo stage: test needed - patch review versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Changes by vterron quinta...@gmail.com: Removed file: http://bugs.python.org/file23477/issue13223.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
vterron quinta...@gmail.com added the comment: Patch updated with the test cases. I have added a third class to Lib/test/pydoc_mod.py and updated two of the existing cases, test_text_doc and test_html_doc, accordingly. The news entry could be: Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods that use 'self' in the example code is generated correctly. -- Added file: http://bugs.python.org/file23801/issue13223.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Changes by vterron quinta...@gmail.com: Added file: http://bugs.python.org/file23802/issue13223_python2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
New submission from Cameron Hayne cameron.ha...@gmail.com: If the docstring for a method has example code that uses 'self', the 'self' will not appear in the HTML generated by pydoc.writedoc Example: #- def getAnswer(self): Return the answer. Example of use: answer = self.getAnswer() return 42 #- The generated HTML will have: getAnswer(self) Return the answer. Example of use: answer = getAnswer() where the final getAnswer is an HTML link. I believe the problem arises on line 553 of the Python 2.7 version of pydoc.py which is as follows: results.append(self.namelink(name, methods, funcs, classes)) The appended text is the same whether or not the method call in the docstring was prefaced with 'self' or not. The 'self' has been eaten up by the regex and is in the 'selfdot' variable which is ignored by the above line. -- components: Library (Lib) messages: 145937 nosy: Cameron.Hayne priority: normal severity: normal status: open title: pydoc removes 'self' in HTML for method docstrings with example code type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +easy nosy: +ezio.melotti stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13223] pydoc removes 'self' in HTML for method docstrings with example code
Víctor Terrón quinta...@gmail.com added the comment: FWIU, only the name of the method, getAnswer, would be a HTML link in the self.getAnswer() line that pydoc should generate, while strong (highlighted) text would be used for instance attributes. I have written a patch for that, by checking for self. matches (and differentiating between methods and instance attributes) *before* trying to match functions or class instantiations. It seems to work, but I will test it thoroughly tomorrow. -- keywords: +patch nosy: +vterron Added file: http://bugs.python.org/file23477/issue13223.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13223 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com