ITADN

bug: overloads_only does not work with merge_init_into_class: true

#308Closedmarkuspi 创建于 2025-08-28
bug
M
markuspicommented
### Description of the bug <!-- Please provide a clear and concise description of what the bug is. --> 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: ```yaml overloads_only: true show_overloads: true separate_signature: true merge_init_into_class: true ``` Python: ```py 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 ``` bash git clone https://github.com/markuspi/mkdocstrings-python-bug-demo cd mkdocstrings-python-bug-demo uv run mkdocs serve ``` ### Expected behavior <!-- Please provide a clear and concise description of what you expected to happen. --> The third signature `Class(a, b)` is hidden. ### Actual behavior The third signature `Class(a, b)` is visible: <img width="770" height="272" alt="Image" src="https://github.com/user-attachments/assets/912fe1e9-3301-456c-90d9-6bd083bba850" /> ### Environment information <!-- Please run the following command in your repository and paste its output below it, redacting sensitive information. --> - __Python__: cpython 3.13.5 - __Environment variables__: - __Installed packages__: - `mkdocstrings-python` v1.18.0
关闭于 2025-08-28 3 条评论