Skip to content

bug: Parent class' __init__ docstring merged into class docstring even if inherited members are not picked up #189

@pawamoy

Description

@pawamoy

Description of the bug

The merge_init_into_class option will merge the docstring of parent __init__ methods into the class docstring even if configuration does not select inherited members.

To Reproduce

  • render a class which has a parent class
  • set merge_init_into_class to true
  • set inherited_members to false
  • observe the parent docstring being merged into the class one

Full traceback

/

Expected behavior

The parent docstring shouldn't be merged into the class one if the parent __init__ method is not selected, or if inherited members are not picked up at all.

Environment information

python -m mkdocstrings_handlers.python.debug  # | xclip -selection clipboard
  • System: /
  • Python: cpython 3.11.5
  • Environment variables:
  • Installed packages:
    • mkdocs v1.6.1
    • mkdocstrings v0.26.1
    • mkdocstrings-python v1.11.1
    • griffe v1.3.2

Additional context

Brought up in the Matrix channel.

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