pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

D102 triggered for functions decorated with `typing.overload` rather than `overload`

Open sigmavirus24 opened this issue 2 years ago • 0 comments

Related to #419 but not quite

As a result of #419, pydocstyle now checks the decorators of a function such that if they match the name overload (and only that) then it skips checking for docstrings. However, not all people like to import from typing and instead import it or import alias it, e.g.,

import typing
import typing as t

This means that then doing

@t.overload
def foo(s: str) -> str:
    ...

# alternatively
@typing.overload
def foo(s: str) -> str:
    ...

Triggers a D102.

sigmavirus24 avatar Oct 17 '21 00:10 sigmavirus24