-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display metadata from typing.Annotated for function parameters #2306
Comments
|
ok, thanks for your reply |
By the way, what is the best practice for adding docstrings to parameters in vscode? |
There isn't a single standard for function/method docstrings in Python, but there are several popular conventions. Pylance supports the following:
If you use one of these forms, you'll see the documentation text for the current parameter as you type a call signature. |
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
The text was updated successfully, but these errors were encountered: