mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-122129: Improve support of method descriptors and wrappers in the help title (GH-122157)
This commit is contained in:
parent
a15feded71
commit
4606eff0aa
3 changed files with 18 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue