basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

`no-untyped-def` false positive on method overload with `/`

Open DetachHead opened this issue 3 years ago • 0 comments

Gist to reproduce

class Foo:
    @overload
    def a(self, a: int, /) -> None: ...

    @overload
    def a(self, b: str, /) -> None: ...

    def a(self, c: int | str, /) -> None: # error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
        ...

Basedmypy version

1.4 / 1.5.0b1

Workaround

Annotating the self resolves the error

DetachHead avatar Jul 29 '22 06:07 DetachHead