20Tauri / DoxyDoxygen

The last word in code documentation generation
140 stars 5 forks source link

Python: __init__ with -> None: at end #140

Closed rwols closed 4 years ago

rwols commented 4 years ago

The following code:

class DottedDict:

    __slots__ = ('_d')

    def __init__(self, d: Optional[Dict[str, Any]] = None) -> None:
        self._d = {}  # type: Dict[str, Any]
        if d is not None:
            self.update(d)

Produces the following template when press Alt+Q on the __init__ token:

class DottedDict:

    __slots__ = ('_d')

    def __init__(self, d: Optional[Dict[str, Any]] = None)
    """
    Constructs a new instance.

    :param      d:    { parameter_description }
    :type       d:    { type_description }
    """ -> None:
        self._d = {}  # type: Dict[str, Any]
        if d is not None:
            self.update(d)

It should instead create this template:

class DottedDict:

    __slots__ = ('_d')

    def __init__(self, d: Optional[Dict[str, Any]] = None) -> None:
        """
        Constructs a new instance.

        :param      d:    { parameter_description }
        :type       d:    { type_description }
        """
        self._d = {}  # type: Dict[str, Any]
        if d is not None:
            self.update(d)
20Tauri commented 4 years ago

Thanks for reporting,

Fixed in 0.76.2 (just released in both evolution and regular versions)

rwols commented 4 years ago

Thanks!