False positives for @overload signatures

Hi. I’m getting a bunch of false positives for situations like this:

@overload
def foo(self, arg: int) -> str:
    ...

@overload
def foo(self, arg: str) -> int:
    ...

def foo(self, arg: Union[str, int]) -> Union[str, int]:
    # do stuff with self

DeepSource complains that I don’t use self int the first two “functions” (PYL-R0201) and that the “function bodies” are empty (PTC-W0049). I already marked those as false positives with an explanation, but it seemed like a good idea to have this issue documented somewhere so that people can add more info, if they’re having a similar problem.

Cheers!

PS: I would include links to relevant issues, but I don’t have enough reputation or something like that.

Hi @Bibo-Joshi!
Thanks for posting this here.
We just deployed a fix for this one and DeepSource should not complain about this now.

1 Like

Thanks for the quick reply! Should have rerun, then :smiley:

This will be effective for all of your upcoming analyses.
Do let us know here if it is raised again.

Hey. Why this has indeed been resolved for PTC-W0049 and PYL-R0201, I do still get PY-D0003 (Missing module/function docstring) for @overload signatures …

Hi @Bibo-Joshi!
PY-D0003 is a separate checker (for docstrings), which was not checking any decorators but just the presence of docstrings.

We are taking a look at it right now.

Update: @overload is now taken care of while looking for missing-docstring issues.