bpo-34966: Improve support of method aliases in pydoc. (GH-9823)

Pydoc now does not duplicate docstrings for aliases of inherited methods.
This commit is contained in:
Serhiy Storchaka 2018-11-08 08:48:11 +02:00 committed by GitHub
parent 6843ffe453
commit a44d34e179
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 104 additions and 4 deletions

View file

@ -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