sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.61k stars 2.13k forks source link

autodoc does not pick up `cached_property` docstring #13138

Open LecrisUT opened 5 days ago

LecrisUT commented 5 days ago

Describe the bug

While the annotations of the cached_property are picked up correctly, the docstring part does not seem to be included

How to Reproduce

import functools

class Foo:
    @functools.cached_property
    def prop(self) -> int:
        """This is documented"""
        return 1

Environment Information

Platform:              linux; (Linux-6.11.7-300.fc41.x86_64-x86_64-with-glibc2.40)
Python version:        3.13.0 (main, Oct  8 2024, 00:00:00) [GCC 14.2.1 20240912 (Red Hat 14.2.1-3)])
Python implementation: CPython
Sphinx version:        8.1.3
Docutils version:      0.21.2
Jinja2 version:        3.1.4
Pygments version:      2.18.0

Sphinx extensions

extensions = [
    "myst_parser",
    "sphinx.ext.intersphinx",
    "sphinx_tippy",
    "sphinx.ext.autodoc",
    "sphinx_autodoc_typehints",
]

Additional context

No response