mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
Patch #711902: Cause pydoc to show data descriptor __doc__ strings.
This commit is contained in:
parent
e86a59af88
commit
e59e2bab8f
5 changed files with 43 additions and 2 deletions
|
@ -686,7 +686,7 @@ class HTMLDoc(Doc):
|
|||
push(msg)
|
||||
for name, kind, homecls, value in ok:
|
||||
base = self.docother(getattr(object, name), name, mod)
|
||||
if callable(value):
|
||||
if callable(value) or inspect.isdatadescriptor(value):
|
||||
doc = getattr(value, "__doc__", None)
|
||||
else:
|
||||
doc = None
|
||||
|
@ -1087,7 +1087,7 @@ class TextDoc(Doc):
|
|||
hr.maybe()
|
||||
push(msg)
|
||||
for name, kind, homecls, value in ok:
|
||||
if callable(value):
|
||||
if callable(value) or inspect.isdatadescriptor(value):
|
||||
doc = getattr(value, "__doc__", None)
|
||||
else:
|
||||
doc = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue