mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
6843ffe453
commit
a44d34e179
3 changed files with 104 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue