]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
docroutine() (both instances): Docstrings for class methods weren't
authorTim Peters <tim.peters@gmail.com>
Thu, 27 Sep 2001 04:08:16 +0000 (04:08 +0000)
committerTim Peters <tim.peters@gmail.com>
Thu, 27 Sep 2001 04:08:16 +0000 (04:08 +0000)
getting displayed, due to a special case here whose purpose I didn't
understand.  So just disabled the doc suppression here.

Another special case here skips the docs when picking apart a method
and finding that the im_func is also in the class __dict__ under
the same name.  That one I understood.  It has a curious consequence,
though, wrt inherited properties:  a static class copies inherited stuff
into the inheriting class's dict, and that affects whether or not this
special case triggers.  The upshoot is that pydoc doesn't show the
function docstrings of getter/setter/deleter functions of inherited
properties in the property section when the class is static, but does
when the class is dynamic (bring up Lib/test/pydocfodder.py under
GUI pydoc to see this).

Lib/pydoc.py

index e5c350bf35f303fe88185a2ae8362930ea302f2b..1e333398b8819ed0f39b8e6e128ac65cd43cc792 100755 (executable)
@@ -759,7 +759,6 @@ TT { font-family: lucidatypewriter, lucida console, courier }
             if cl:
                 if imclass is not cl:
                     note = ' from ' + self.classlink(imclass, mod)
-                    skipdocs = 1
             else:
                 if object.im_self:
                     note = ' method of %s instance' % self.classlink(
@@ -1117,7 +1116,6 @@ class TextDoc(Doc):
             if cl:
                 if imclass is not cl:
                     note = ' from ' + classname(imclass, mod)
-                    skipdocs = 1
             else:
                 if object.im_self:
                     note = ' method of %s instance' % classname(