Title: bug: Class init parameter name disappears from attribute docstring using `separate_signature` · Issue #215 · mkdocstrings/python · GitHub
Open Graph Title: bug: Class init parameter name disappears from attribute docstring using `separate_signature` · Issue #215 · mkdocstrings/python
X Title: bug: Class init parameter name disappears from attribute docstring using `separate_signature` · Issue #215 · mkdocstrings/python
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 an...
Open Graph 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 docst...
X 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 docst...
Opengraph URL: https://github.com/mkdocstrings/python/issues/215
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: Class init parameter name disappears from attribute docstring using `separate_signature`","articleBody":"### Description of the bug\r\nWhen 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.\r\n\r\n### To Reproduce\r\n\u003cdetails\u003e\r\n\r\n```console\r\npython -m venv .venv\r\n. .venv/bin/activate\r\npip install mkdocstrings-python\r\npython\r\n```\r\n\r\n```yaml\r\n# mkdocs.yml\r\nsite_name: test-site\r\nplugins:\r\n - mkdocstrings:\r\n default_handler: python\r\n handlers:\r\n python:\r\n options:\r\n separate_signature: true\r\n```\r\n\r\n```markdown\r\n\u003c!-- test.md --\u003e\r\n::: test\r\n```\r\n\r\n```python\r\n# test.py\r\n\r\nclass SomeClass:\r\n \"\"\"This is a class that does something.\"\"\"\r\n\r\n def __init__(self, some_float: float) -\u003e None:\r\n self.as_hex = some_float.hex()\r\n \"\"\"The hex value of the input float.\"\"\"\r\n```\r\n\u003c/details\u003e\r\n\r\n### Expected behavior\r\n\r\n\r\nI expect the rendered docstring for the `as_hex` instance attribute to say `as_hex = some_float.hex()`.\r\n\r\n### Actual behavior\r\n\r\n\r\nWith `separate_signature: true`, the `some_float` part disappears, and what is rendered is only `as_hex = hex()`.\r\n\r\n\r\n### Environment information\r\n```bash\r\npython -m mkdocstrings_handlers.python.debug # | xclip -selection clipboard\r\n```\r\n\r\n- __System__: Linux-6.8.0-49-generic-x86_64-with-glibc2.39\r\n- __Python__: cpython 3.13.1 (/home/stefan/test-mkdocstrings/.venv/bin/python)\r\n- __Environment variables__:\r\n- __Installed packages__:\r\n - `mkdocs` v1.6.1\r\n - `mkdocstrings` v0.27.0\r\n - `mkdocstrings-python` v1.12.2\r\n - `griffe` v1.5.1","author":{"url":"https://github.com/connesy","@type":"Person","name":"connesy"},"datePublished":"2024-12-11T13:45:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/215/python/issues/215"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e713731f-a14d-027e-7702-b7cb9b20c3d4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E56:1E76C4:7D3333:A9213B:6A62828F |
| html-safe-nonce | 5b2ac1d49a28d69e1bf844cb3e9d91ab421d7437f814b423d06a3a574794f814 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTU2OjFFNzZDNDo3RDMzMzM6QTkyMTNCOjZBNjI4MjhGIiwidmlzaXRvcl9pZCI6IjQ2NjQzMDYxMDgzOTE5MTYxNzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cdfcf7dc6c9c951c3092b4e99c8c1bf34a02e31652b762706f9240d46511f0a2 |
| hovercard-subject-tag | issue:2733025198 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/mkdocstrings/python/215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ac9d1242a5fb19636e127f26338d88544a000281d4828f14f8091fdf2013b529/mkdocstrings/python/issues/215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ac9d1242a5fb19636e127f26338d88544a000281d4828f14f8091fdf2013b529/mkdocstrings/python/issues/215 |
| og:image:alt | 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 docst... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | connesy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 834f5745a0905171956ffda6a4bdff25548a80194071fe4a15acaa5b349a60a0 |
| turbo-cache-control | no-preview |
| go-import | github.com/mkdocstrings/python git https://github.com/mkdocstrings/python.git |
| octolytics-dimension-user_id | 75664361 |
| octolytics-dimension-user_login | mkdocstrings |
| octolytics-dimension-repository_id | 422878404 |
| octolytics-dimension-repository_nwo | mkdocstrings/python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 422878404 |
| octolytics-dimension-repository_network_root_nwo | mkdocstrings/python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4d79f1b99472a521fc5fb66e9fdc3ce742937dff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width