summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-07-23 17:45:21 (GMT)
committerGitHub <noreply@github.com>2024-07-23 17:45:21 (GMT)
commit4606eff0aa01d6ce30d25b05ed347567ea59b00b (patch)
treea67f2a1cb0bce6fd3de33276f736a49c27a6f11e /Lib/pydoc.py
parenta15feded71dd47202db169613effdafc468a8cf3 (diff)
downloadcpython-4606eff0aa01d6ce30d25b05ed347567ea59b00b.zip
cpython-4606eff0aa01d6ce30d25b05ed347567ea59b00b.tar.gz
cpython-4606eff0aa01d6ce30d25b05ed347567ea59b00b.tar.bz2
gh-122129: Improve support of method descriptors and wrappers in the help title (GH-122157)
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r--Lib/pydoc.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 768c3dc..d376592 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1682,6 +1682,13 @@ def describe(thing):
return 'function ' + thing.__name__
if inspect.ismethod(thing):
return 'method ' + thing.__name__
+ if inspect.ismethodwrapper(thing):
+ return 'method wrapper ' + thing.__name__
+ if inspect.ismethoddescriptor(thing):
+ try:
+ return 'method descriptor ' + thing.__name__
+ except AttributeError:
+ pass
return type(thing).__name__
def locate(path, forceload=0):