8000 bug: overloads_only does not work with merge_init_into_class: true · Issue #308 · mkdocstrings/python · GitHub
[go: up one dir, main page]

Skip to content

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

@markuspi

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

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

    0