Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pawamoy opened this issue Oct 10, 2024 · 1 comment · Fixed by #210
Assignees
Labels
bug Something isn't working

Comments

@pawamoy
Copy link
Member

pawamoy commented Oct 10, 2024

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.

@pawamoy pawamoy added the unconfirmed This bug was not reproduced yet label Oct 10, 2024
@pawamoy pawamoy self-assigned this Oct 10, 2024
@pawamoy pawamoy added bug Something isn't working and removed unconfirmed This bug was not reproduced yet labels Oct 10, 2024
@pawamoy
Copy link
Member Author

pawamoy commented Nov 26, 2024

I decided to keep to showing the source of the inherited __init__ method (even if not selected through inherited_members), as well as the signature. I believe these blocks of info are still valuable, and only the "docstring merging" was to fixed here.

pawamoy added a commit that referenced this issue Nov 26, 2024
…such inherited method wasn't selected through the `inherited_members` configuration option

Issue-189: #189
pawamoy added a commit that referenced this issue Nov 26, 2024
…such inherited method wasn't selected through the `inherited_members` configuration option

Issue-189: #189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant