summaryrefslogtreecommitdiff
path: root/numpydoc/docscrape.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpydoc/docscrape.py')
-rw-r--r--numpydoc/docscrape.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py
index 9496f9d..e5c07f5 100644
--- a/numpydoc/docscrape.py
+++ b/numpydoc/docscrape.py
@@ -12,6 +12,13 @@ import copy
import sys
+# TODO: Remove try-except when support for Python 3.7 is dropped
+try:
+ from functools import cached_property
+except ImportError: # cached_property added in Python 3.8
+ cached_property = property
+
+
def strip_blank_lines(l):
"Remove leading and trailing blank lines from a list of lines"
while l and not l[0].strip():
@@ -706,7 +713,7 @@ class ClassDoc(NumpyDocString):
not name.startswith("_")
and (
func is None
- or isinstance(func, property)
+ or isinstance(func, (property, cached_property))
or inspect.isdatadescriptor(func)
)
and self._is_show_member(name)