Open
Description
Description of the bug
When calling a method on an input argument to a class __init__
while having separate_signature: true
, the parameter name disappears from the rendered instance attribute docstring, leaving only the attribute name and the method called on the input argument.
To Reproduce
python -m venv .venv
. .venv/bin/activate
pip install mkdocstrings-python
python
# mkdocs.yml
site_name: test-site
plugins:
- mkdocstrings:
default_handler: python
handlers:
python:
options:
separate_signature: true
<!-- test.md -->
::: test
# test.py
class SomeClass:
"""This is a class that does something."""
def __init__(self, some_float: float) -> None:
self.as_hex = some_float.hex()
"""The hex value of the input float."""
Expected behavior
I expect the rendered docstring for the as_hex
instance attribute to say as_hex = some_float.hex()
.
Actual behavior
With separate_signature: true
, the some_float
part disappears, and what is rendered is only as_hex = hex()
.
Environment information
python -m mkdocstrings_handlers.python.debug # | xclip -selection clipboard
- System: Linux-6.8.0-49-generic-x86_64-with-glibc2.39
- Python: cpython 3.13.1 (/home/stefan/test-mkdocstrings/.venv/bin/python)
- Environment variables:
- Installed packages:
mkdocs
v1.6.1mkdocstrings
v0.27.0mkdocstrings-python
v1.12.2griffe
v1.5.1