Skip to content

bug: overloads_only does not work with merge_init_into_class: true #308

Closed

Description

@markuspi

Description of the bug

Using the new overloads_only: true option introduced in #286 does not work for __init__ functions when merge_init_into_class: true is set.

To Reproduce

Options:

overloads_only: true
show_overloads: true
separate_signature: true
merge_init_into_class: true

Python:

from typing import overload

class Class:
    @overload
    def __init__(self, a: int, b: str): ...
    @overload
    def __init__(self, a: str, b: int): ...
    def __init__(self, a: int | str, b: int | str):
        """Some docstring."""

MRE

git clone https://github.com/markuspi/mkdocstrings-python-bug-demo
cd mkdocstrings-python-bug-demo
uv run mkdocs serve

Expected behavior

The third signature Class(a, b) is hidden.

Actual behavior

The third signature Class(a, b) is visible:

Image

Environment information

  • Python: cpython 3.13.5
  • Environment variables:
  • Installed packages:
    • mkdocstrings-python v1.18.0

Activity

  1. added
    unconfirmed
    on Aug 28, 2025
  2. pawamoy commented on Aug 28, 2025

    @pawamoy
    Member

    Thanks for the report @markuspi, on it 🙂

  3. added
    bug
    and removed
    unconfirmed
    on Aug 28, 2025
  4. pawamoy commented on Aug 28, 2025

    @pawamoy
    Member

    Fixed in v1.18.1!

  5. markuspi commented on Aug 28, 2025

    @markuspi
    Author

    Awesome! Thanks for the quick reply 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions