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:
Environment information
- Python: cpython 3.13.5
- Environment variables:
- Installed packages:
mkdocstrings-python v1.18.0
Description of the bug
Using the new
overloads_only: trueoption introduced in #286 does not work for__init__functions whenmerge_init_into_class: trueis set.To Reproduce
Options:
Python:
MRE
git clone https://github.com/markuspi/mkdocstrings-python-bug-demo cd mkdocstrings-python-bug-demo uv run mkdocs serveExpected behavior
The third signature
Class(a, b)is hidden.Actual behavior
The third signature
Class(a, b)is visible:Environment information
mkdocstrings-pythonv1.18.0