We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
param_hint
BadParameter
The documentation and the type annotations don't quite match for click.BadParameter, specifically for the param_hint argument. The documentation says:
click.BadParameter
If it is a string it's used as such, if it's a list then each item is quoted and separated.
But the type annotation says:
param_hint: str | None = None
To reproduce, create code like:
raise click.BadParameter("FOOBIE BLETCH", param_hint=["HACKEM", "MUCHE"])
then run mypy on said code.
mypy
Expected: mypy gives no error
Actual behaviour: mypy says:
foo.py:2: error: Argument "param_hint" to "BadParameter" has incompatible type "list[str]"; expected "str | None" [arg-type]
Easy to fix, just need to update the type hint for param_hint to the one already used in _join_param_hints:
_join_param_hints
cabc.Sequence[str] | str | None
Environment:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The documentation and the type annotations don't quite match for
click.BadParameter
, specifically for theparam_hint
argument. The documentation says:But the type annotation says:
To reproduce, create code like:
then run
mypy
on said code.Expected:
mypy
gives no errorActual behaviour:
mypy
says:Easy to fix, just need to update the type hint for
param_hint
to the one already used in_join_param_hints
:Environment:
The text was updated successfully, but these errors were encountered: