cbillingham/docconvert

The docstrings of nested functions are not converted

Closed this issue · 0 comments

docconvert is not converting nested function docstrings. For example, the following was not converted correctly:

def outer_func(arg):
    """
    Do something.

    :param arg: Dictionary to convert.
    :type arg: dict(str, str)
    """
    def inner(key, value):
        """
        Format a key and value to a k=v string.

        :param key: The key.
        :type key: str

        :param value: The value.
        :type value: str

        :returns: The formatted key and value.
        :rtype: str
        """
        return "{0}={1}".format(key, value)
    return " ".join(inner(k, v) for k, v in arg.items())

Which was converted to, which is only partially correct:

def outer_func(arg):
    """Do something.

    Args:
        arg (dict(str, str)): Dictionary to convert.
    """
    def inner(key, value):
        """Format a key and value to a k=v string.

        :param key: The key.
        :type key: str

        :param value: The value.
        :type value: str

        :returns: The formatted key and value.
        :rtype: str
        """
        return "{0}={1}".format(key, value)
    return " ".join(inner(k, v) for k, v in arg.items())