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.
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."""
I expect the rendered docstring for the as_hex
instance attribute to say as_hex = some_float.hex()
.
With separate_signature: true
, the some_float
part disappears, and what is rendered is only as_hex = hex()
.
python -m mkdocstrings_handlers.python.debug # | xclip -selection clipboard
mkdocs
v1.6.1mkdocstrings
v0.27.0mkdocstrings-python
v1.12.2griffe
v1.5.1Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too