numpy / numpydoc

Numpy's Sphinx extensions
https://numpydoc.readthedocs.io/
Other
294 stars 160 forks source link

`Validator.method_source` returns `""` for `property` and `cached_property` #551

Open anmyachev opened 4 months ago

anmyachev commented 4 months ago

An interesting detail is that source_file_def_line method takes into account these types of objects and correctly finds the source code of the functions wrapped in these properties.

https://github.com/numpy/numpydoc/blob/e7c6baf00f5f73a4a8f8318d0cb4e04949c9a5d1/numpydoc/validate.py#L313-L324

anmyachev commented 4 months ago

Validator.name also doesn't work for functools.cached_property.