readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
415 stars 126 forks source link

Treat methods decorated with `functools.cached_property` as properties #436

Closed michellewang closed 1 week ago

michellewang commented 2 months ago

Thank you for this great project!

I notice that methods decorated with functools.cached_property (introduced in Python 3.8) render as generic methods, while those decorated with property are handled differently (leading property keyword, no round brackets):

Screenshot 2024-04-11 at 9 30 44 PM

This is misleading since cached properties are not supposed to be called like normal methods. Would it be possible to make it so that cached properties are rendered in the same way as properties? It looks like sphinx.ext.autodoc has been updated to do this.