stubtest: more concise error for forgotten arguments
Open
Nobody has claimed this yet.
feature
topic-stubtest
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
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"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example with python -m mypy.stubtest a --concise and inspect the stubtest entry point and its argument-mismatch reporting. Update the concise output so a missing argument produces one error rather than cascading mismatches, then add or update coverage for the shown case and run the relevant stubtest tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100