Add detailed type annotations for param and command decorators, explicitly listing all kwargs #47
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.
Closes #21.
Why a stub file?
I used a stub .pyi file for annotating
@argument
and@option
. This was convenient because of how Click handles arguments passed to these decorators, sometimes assuming an argument is notNone
just because it is in**kwargs
. For this reasons, arguments must be collected and processed to remove allNone
. Given the large number of arguments in these decorators, this also has a performance impact (arguably irrelevant, but still an order of magnitude increase).Work left out for the future
(In
@command
and@group
make all arguments butname
keyword-only #46) Make all arguments of@command
and@group
butname
keyword-only.Autocompletion arguments. The arguments:
autocompletion
, which is deprecated in Click 8.0 and will be removed in Click 8.1shell_complete
, which supersedes the previouswere not included because Cloup currently supports both
click >= 7.2
. I'll addshell_complete
when support for Click 7 is dropped.