heavenshell / vim-pydocstring

Generate Python docstring to your Python source code.
BSD 3-Clause "New" or "Revised" License
337 stars 53 forks source link

default parameter problem #46

Closed rsacherer closed 6 years ago

rsacherer commented 6 years ago

If you add type hinting with default values, the doc string created is messed up:

 def get_last(self, product: str = None):
        """get_last

        :param None:
        """
        if not product:
            product = self._default_product
heavenshell commented 6 years ago

@muahdib69 Thx for reporting this. This is a bug...

May be we should generate like followings?

def get_last(self, product: str = None):
    """get_last

    :param product:
    :type product: str
    """

Type hinting is very complex to parse by Vim script. Please stay tuned...