cpython: 7aa72075d440 (original) (raw)

Mercurial > cpython

changeset 91072:7aa72075d440 3.4

don't remove self from example code in the HTML output (closes #13223) Patch by Víctor Terrón. [#13223]

Benjamin Peterson benjamin@python.org
date Sat, 07 Jun 2014 16:44:00 -0700
parents b8f9ae84d211
children cddb17c4975e ddc174c4c7e5
files Lib/pydoc.py Lib/test/pydoc_mod.py Lib/test/test_pydoc.py Misc/NEWS
diffstat 4 files changed, 64 insertions(+), 2 deletions(-)[+] [-] Lib/pydoc.py 9 Lib/test/pydoc_mod.py 10 Lib/test/test_pydoc.py 44 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -595,10 +595,15 @@ class HTMLDoc(Doc): elif pep: url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep) results.append('%s' % (url, escape(all)))

--- a/Lib/test/pydoc_mod.py +++ b/Lib/test/pydoc_mod.py @@ -15,6 +15,16 @@ class B(object): NO_MEANING = "eggs" pass +class C(object):

+ def doc_func(): """ This function solves all of the world's problems:

--- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -47,6 +47,7 @@ CLASSES builtins.object A B

\x20\x20\x20\x20 class A(builtins.object) | Hello and goodbye @@ -74,6 +75,26 @@ CLASSES | Data and other attributes defined here: |\x20\x20 | NO_MEANING = 'eggs' +\x20\x20\x20\x20

FUNCTIONS doc_func() @@ -124,6 +145,7 @@ expected_html_pattern = """

A
B +
C
@@ -165,6 +187,28 @@ Data descriptors defined here:
Data and other attributes defined here:
NO_MEANING = 'eggs'
+

+

+ + +\x20\x20\x20\x20 + +
 
+class C(builtins.object)
    Methods defined here:
+
get_answer(self)
Return say_no()
+ +
is_it_true(self)
Return self.get_answer()
+ +
say_no(self)
+ +
+Data descriptors defined here:
+
dict
+
dictionary for instance variables (if defined)
+
+
weakref
+
list of weak references to the object (if defined)
+

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -22,6 +22,9 @@ Core and Builtins Library ------- +- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods