summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorEugene Toder <eltoder@users.noreply.github.com>2024-02-20 15:14:34 (GMT)
committerGitHub <noreply@github.com>2024-02-20 15:14:34 (GMT)
commitc0b0c2f2015fb27db4306109b2b3781eb2057c2b (patch)
tree49b34e2f7d762b0abeb3c09e508c8e2fd9255c08 /Lib/pydoc.py
parent9af80ec83d1647a472331bd1333a7fa9108fe98e (diff)
downloadcpython-c0b0c2f2015fb27db4306109b2b3781eb2057c2b.zip
cpython-c0b0c2f2015fb27db4306109b2b3781eb2057c2b.tar.gz
cpython-c0b0c2f2015fb27db4306109b2b3781eb2057c2b.tar.bz2
gh-101860: Expose __name__ on property (GH-101876)
Useful for introspection and consistent with functions and other descriptors.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 9bb64fe..d32fa8d 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -127,9 +127,8 @@ def _finddoc(obj):
cls = self.__class__
# Should be tested before isdatadescriptor().
elif isinstance(obj, property):
- func = obj.fget
- name = func.__name__
- cls = _findclass(func)
+ name = obj.__name__
+ cls = _findclass(obj.fget)
if cls is None or getattr(cls, name) is not obj:
return None
elif inspect.ismethoddescriptor(obj) or inspect.isdatadescriptor(obj):