Currently, we can use a google or other style function docstring to document parameters that we can see when using the function,
but it has these disadvantages
- The documentation of the parameters is not together with the parameters, sometimes it is difficult to quickly find the documentation in the docstring of the function
- While you can use some extensions to automatically generate docstrings, you need to sync it every time you change the parameter definition
Since after PEP 593, python now supports typing.Annotated to provide metadata, why not display the metadata by the way, but only the type of the parameter?
suppose we have this function definition
def test_func(arg: Annotated[int, "some document for this arg", ValueRange(100, 200)]):
pass
what i want is
from

to

I know that when I hold down the Ctrl key I can find the full definition, but if we can see the metadata (including some "documentation") just hover over the parameter, It will be better in actual use.
Related discussion
Currently, we can use a google or other style function docstring to document parameters that we can see when using the function,
but it has these disadvantages
Since after PEP 593, python now supports typing.Annotated to provide metadata, why not display the metadata by the way, but only the type of the parameter?
suppose we have this function definition
what i want is

from
to

I know that when I hold down the Ctrl key I can find the full definition, but if we can see the metadata (including some "documentation") just hover over the parameter, It will be better in actual use.
Related discussion