diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-11-07 23:08:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-07 23:08:05 -0800 |
commit | 9d3658147b56e24e96e174510b6ee91c8141e530 (patch) | |
tree | e908c4b879cc73f976ffc33c519325c7dc67c550 /Lib/pydoc.py | |
parent | 3ba5e253de1a52e9692aa645c95072705f08b7bb (diff) | |
download | cpython-git-9d3658147b56e24e96e174510b6ee91c8141e530.tar.gz |
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 8a6b27b16e..09992cd082 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -958,8 +958,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 @@ -1375,8 +1374,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 |