We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sphinx_cached_property.py
1 parent ec89dd2 commit fdccaa5Copy full SHA for fdccaa5
src/attrs/sphinx_cached_property.py
@@ -15,13 +15,19 @@
15
def get_cached_property_for_member_descriptor(
16
cls: type, name: str, default=None
17
):
18
+ """If the attribute is for a cached property, return the ``cached_property``
19
+
20
+ Otherwise, delegate to normal ``getattr``
21
22
+ """
23
props = getattr(cls, "__attrs_cached_properties__", None)
24
if props is None or name not in props:
25
return getattr(cls, name, default)
26
return props[name]
27
28
29
def setup(app: Sphinx):
30
+ """Install the special attribute getter for cached properties of slotted classes"""
31
app.add_autodoc_attrgetter(
32
object, get_cached_property_for_member_descriptor
33
)
0 commit comments