You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sphinx analyses properties created with the @functools.cached_property as a normal property using the PropertyDocumenter which sphinx-immaterial patches with additional _get_property_return_type function. That assumes the property object has a .fget attribute/method which, however, is not the case for cached_property objects, hence failing with AttributeError:
File "/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 1792, in document_members
super().document_members(all_members)
File "/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 857, in document_members
documenter.generate(
File "/lib/python3.9/site-packages/sphinx/ext/autodoc/__init__.py", line 910, in generate
if not self.import_object():
File "/lib/python3.9/site-packages/sphinx_immaterial/autodoc_property_type.py", line 41, in import_object
self.retann = _get_property_return_type(self.object)
File "/lib/python3.9/site-packages/sphinx_immaterial/autodoc_property_type.py", line 15, in _get_property_return_type
if obj.fget is None:
AttributeError: 'cached_property' object has no attribute 'fget'
The text was updated successfully, but these errors were encountered:
antonymayi
added a commit
to antonymayi/sphinx-immaterial
that referenced
this issue
May 25, 2022
Sphinx analyses properties created with the
@functools.cached_property
as a normal property using thePropertyDocumenter
whichsphinx-immaterial
patches with additional_get_property_return_type
function. That assumes the property object has a.fget
attribute/method which, however, is not the case forcached_property
objects, hence failing withAttributeError
:The text was updated successfully, but these errors were encountered: