summaryrefslogtreecommitdiff
path: root/sphinx/util/inspect.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/inspect.py')
-rw-r--r--sphinx/util/inspect.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index 10673ca57..8bea91e96 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -220,10 +220,10 @@ def isstaticmethod(obj: Any, cls: Any = None, name: str | None = None) -> bool:
def isdescriptor(x: Any) -> bool:
"""Check if the object is some kind of descriptor."""
- for item in '__get__', '__set__', '__delete__':
- if callable(safe_getattr(x, item, None)):
- return True
- return False
+ return any(
+ callable(safe_getattr(x, item, None))
+ for item in ['__get__', '__set__', '__delete__']
+ )
def isabstractmethod(obj: Any) -> bool: