Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have some mypy/typing stubs here for Docopt. Would this be something that Docopt is interested in doing? I can always use these locally, but I wanted to at least ask if you were open to the idea of adding this stub file to Docopt. It doesn't add any dependencies or anything, or change the way Docopt behaves. It's an opt-in feature that only benefits people that want to use it (see mypy and pep-484).
There is another possible route for people that want to type check with the Docopt module, which is typeshed. They can be added there instead of this repo, but it still requires consent from the Docopt team.
This would catch type errors such as this:
The stubs would need to be updated when function/method signatures change, or new ones are added. I wouldn't mind chipping in if no one else wants to.
I've tried to be as precise as possible with the types, and I've been running it against
test_docopt.py
. The tests use more of thedocopt
module than most projects I think. So far mypy doesn't generate any warnings/errors. You can check it out yourself in this branch:What do you think? Is it too much for a simple library like Docopt?