diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-11-08 07:20:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-08 07:20:27 (GMT) |
commit | 11a33e171b89ea9267672b0664d739ca06e459ca (patch) | |
tree | 492e5c44bfad763a0640e7bcb404451ab61c791b /Lib/pydoc.py | |
parent | de25071f49b3f9bf9cdef32204a4516bbb259626 (diff) | |
download | cpython-11a33e171b89ea9267672b0664d739ca06e459ca.zip cpython-11a33e171b89ea9267672b0664d739ca06e459ca.tar.gz cpython-11a33e171b89ea9267672b0664d739ca06e459ca.tar.bz2 |
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Pydoc now does not duplicate docstrings for aliases of inherited methods.
(cherry picked from commit a44d34e17908a49d584f86c4f8642a50707b7150)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r-- | Lib/pydoc.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index fffa2d5..b521a55 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -941,8 +941,7 @@ class HTMLDoc(Doc): if name == realname: title = '<a name="%s"><strong>%s</strong></a>' % (anchor, realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: reallink = '<a href="#%s">%s</a>' % ( cl.__name__ + '-' + realname, realname) skipdocs = 1 @@ -1346,8 +1345,7 @@ location listed above. if name == realname: title = self.bold(realname) else: - if (cl and realname in cl.__dict__ and - cl.__dict__[realname] is object): + if cl and inspect.getattr_static(cl, realname, []) is object: skipdocs = 1 title = self.bold(name) + ' = ' + realname argspec = None |