Could this be a use case for typing.Annotated?
In [6]: from dataclasses import dataclass
In [7]: from typing import Annotated
In [8]: class A:
...: """Docstring for class A."""
...: x: Annotated[int, "Docstring for x"]
...: y: Annotated[bool, "Docstring for y"] = True
In [9]: A.__annotations__
Out[9]:
{'x': typing.Annotated[int, 'Docstring for x'],
'y': typing.Annotated[bool, 'Docstring for y']}
The syntax is a bit arduous; I'd be in favor of thinking through ways to make it easier to write. But the basic functionality already exists; there's no reason to duplicate it with another language feature.
Rick.
---
Ricky.
"I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler