pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

D107 (Missing docstring in __init__) conflicts with D418 (@overload shouldn't contain docstring)

Open rigelifland opened this issue 2 years ago • 1 comments

You can't overload an init without failing one or the other of these rules currently:

class A:
    @overload
    def __init__(self):
                           # This fails D107: Missing docstring in __init__
        pass

    def __init__(self):
        """Docstring."""
        pass

class B:
    @overload
    def __init__(self):
        """Docstring."""  # This fails D418: Function/ Method decorated with @overload shouldn't contain a docstring
        pass

    def __init__(self):
        """Docstring."""
        pass

rigelifland avatar Dec 19 '22 17:12 rigelifland

Duplicate of #525

adamjstewart avatar Jan 02 '23 05:01 adamjstewart