numpy / numpy/numpydoc

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

Open
#551 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
355
Forks
181
Avg merge
1d 9h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in numpydoc/validate.py by comparing Validator.method_source with source_file_def_line around lines 313-324. Trace how property and cached_property objects are handled, then verify that method_source reports their wrapped functions' source instead of an empty string.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.