PyCQA / pydocstyle

docstring style checker
http://pydocstyle.org
MIT License
1.11k stars 188 forks source link

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

Open rigelifland opened 1 year ago

rigelifland commented 1 year ago

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
adamjstewart commented 1 year ago

Duplicate of #525