mypy icon indicating copy to clipboard operation
mypy copied to clipboard

stubtest: more concise error for forgotten arguments

Open twoertwein opened this issue 3 years ago • 0 comments

Feature

When the implementation adds new arguments (or the stubs forget some of the arguments), stubtest creates many errors if the new/forgotten argument isn't the last argument.

$ cat a.py
def fun(a, b, c, d, e): ...

$ cat a.pyi 
def fun(b, c, d, e): ...

$ python -m mypy.stubtest a --concise
a.fun is inconsistent, stub argument "b" differs from runtime argument "a"
a.fun is inconsistent, stub argument "c" differs from runtime argument "b"
a.fun is inconsistent, stub argument "d" differs from runtime argument "c"
a.fun is inconsistent, stub argument "e" differs from runtime argument "d"
a.fun is inconsistent, stub does not have argument "e"

Pitch

$ python -m mypy.stubtest a --concise
a.fun is inconsistent, stub does not have argument "a"

twoertwein avatar Sep 18 '22 17:09 twoertwein