diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-07-23 17:45:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-23 17:45:21 (GMT) |
commit | 4606eff0aa01d6ce30d25b05ed347567ea59b00b (patch) | |
tree | a67f2a1cb0bce6fd3de33276f736a49c27a6f11e /Lib/pydoc.py | |
parent | a15feded71dd47202db169613effdafc468a8cf3 (diff) | |
download | cpython-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.py | 7 |
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): |