Skip to content

bug: Duplicated parameter section in generated method documentation #13

@willemkokke

Description

@willemkokke

Description of the bug

When griffe-typingdoc is enabled, the parameter section is duplicated if it is also documented in the normal docstring.

To Reproduce

git clone https://github.com/willemkokke/griffe-typingdoc-repro
cd griffe-typingdoc-repro
uv run mkdocs serve --open --verbose

Expected behavior

If no pep 727 documentation for parameters is provided, only display the parameter documentation from the docstring.
If both are provided.. no strong opinion on whether they're merged or if one or the other takes precendence

Environment information

  • System: macOS-15.2-arm64-arm-64bit
  • Python: cpython 3.11.11 (/Users/willem/Documents/Repositories/griffe-typingdoc-repro/.venv/bin/python3)
  • Environment variables:
  • Installed packages:
    • griffe-typingdoc v0.2.7

Additional context

Ignore the str: in the description In the screenshots, I took them before I removed the typing information from the docstring

class Example:

    def __init__(self):
        """Example class."""
        pass

    def method(self, text: str):
        """Method to test.

            Args:
                text: text to print.
        """
        print(text)

Enabled:

Enabled

Disabled:

Disabled

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions