mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-101860: Expose __name__ on property (GH-101876)
Useful for introspection and consistent with functions and other descriptors.
This commit is contained in:
parent
9af80ec83d
commit
c0b0c2f201
8 changed files with 158 additions and 25 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue