summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-11-08 06:48:11 (GMT)
committerGitHub <noreply@github.com>2018-11-08 06:48:11 (GMT)
commita44d34e17908a49d584f86c4f8642a50707b7150 (patch)
tree56d51dcfd99fa38087b9130b67d25a5c501eac4e /Lib/pydoc.py
parent6843ffe4533e9f2cde036296fd932fef6f059687 (diff)
downloadcpython-a44d34e17908a49d584f86c4f8642a50707b7150.zip
cpython-a44d34e17908a49d584f86c4f8642a50707b7150.tar.gz
cpython-a44d34e17908a49d584f86c4f8642a50707b7150.tar.bz2
bpo-34966: Improve support of method aliases in pydoc. (GH-9823)
Pydoc now does not duplicate docstrings for aliases of inherited methods.
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r--Lib/pydoc.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 3a46171..54e6ce8 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
@@ -1393,8 +1392,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