Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

D102 triggered for functions decorated with typing.overload rather than overload #555

Open
sigmavirus24 opened this issue Oct 17, 2021 · 0 comments

Comments

@sigmavirus24
Copy link
Member

sigmavirus24 commented Oct 17, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant