numpy / numpy/numpydoc

Feature request: Add support for dataclasses

Open
#604 3 comments 2 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

At the moment numpydoc will ignore "Attributes" section for dataclasses (or maybe I don't quite understand how to document dataclasses properly):

@dataclass
class Klass:
    """
    Klass description.

    Attributes
    ----------
    attr: int
        Some attribute description.
    """

    attr: int

It would be great to have such a feature.

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

The issue names no files or tests; start by locating numpydoc's handling of the Attributes section and checking how the dataclass example is currently parsed. Done means the documented attr field is recognized for dataclasses, with coverage for the shown example and any clarified documentation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.