pixelneo/vim-python-docstring

Use of Type Hinting

mts299 opened this issue · 3 comments

mts299 commented

Add parameter/return types when users include type hint in their code

Hello, thank you for suggestion. The parameter types should already work with the :DocstringTypes command

def foo(A: list[dict[str, str]]) -> int:
    return 1

would get this docstring:

def foo(A: list[dict[str, str]]) -> int:
    """

    Args:
        A (list[dict[str, str]]):

    Returns:
        

    """
    return 1

I plan to include the return type as well.

mts299 commented

One other thing, does class documentation not include the methods?

If not I can make another issue if you want :)

I can try to help with coding or testing when I find more time, I really enjoy this plugin <3

Sorry, for the delay...

🤔 you are correct, the class docstring does not contain methods (I use google docstring 99% of the time, which doesn't include it, so I haven't even considered it).

Yes, please create a new issue for this. Definitely, you can try to code the functionality, any MRs are welcome – I can help you with it if you want. (honestly, I don't know when I'll have time to write it myself – it will happen, just can't promise anything.)

Happy to hear, you enjoy the plugin ❤️