class _NumberRangeBase(_NumberParamTypeBase):
Known subclasses: click.types.FloatRange
, click.types.IntRange
Undocumented
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | _clamp |
Find the valid value to clamp to bound in the given direction. |
Method | _describe_range |
Describe the range for use in help text. |
Method | convert |
Convert the value to the correct type. This is not called if the value is None (the missing value). |
Method | to_info_dict |
Gather information that could be useful for a tool generating user-facing documentation. |
Instance Variable | clamp |
Undocumented |
Instance Variable | max |
Undocumented |
Instance Variable | max_open |
Undocumented |
Instance Variable | min |
Undocumented |
Instance Variable | min_open |
Undocumented |
Inherited from _NumberParamTypeBase
:
Class Variable | _number_class |
Undocumented |
Inherited from ParamType
(via _NumberParamTypeBase
):
Method | __call__ |
Undocumented |
Method | fail |
Helper method to fail with an invalid value message. |
Method | get_metavar |
Returns the metavar default for this param if it provides one. |
Method | get_missing_message |
Optionally might return extra information about a missing parameter. |
Method | shell_complete |
No summary |
Method | split_envvar_value |
Given a value from an environment variable this splits it up into small chunks depending on the defined envvar list splitter. |
Class Variable | arity |
Undocumented |
Class Variable | envvar_list_splitter |
Undocumented |
Class Variable | is_composite |
Undocumented |
Class Variable | name |
Undocumented |
click.types.FloatRange
Undocumented
Parameters | |
min:t.Optional[ | Undocumented |
max:t.Optional[ | Undocumented |
min_open:bool | Undocumented |
max_open:bool | Undocumented |
clamp:bool | Undocumented |
click.types.FloatRange
, click.types.IntRange
Parameters | |
bound:float | The boundary value. |
dir:te.Literal[ | 1 or -1 indicating the direction to move. |
open:bool | If true, the range does not include the bound. |
Returns | |
float | Undocumented |
click.types._NumberParamTypeBase.convert
Convert the value to the correct type. This is not called if the value is None (the missing value).
This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The param and ctx arguments may be None in certain situations, such as when converting prompt input.
If the value cannot be converted, call fail
with a
descriptive message.
Parameters | |
value:t.Any | The value to convert. |
param:t.Optional[ | The parameter that is using this type to convert its value. May be None. |
ctx:t.Optional[ | The current context that arrived at this value. May be None. |
Returns | |
t.Any | Undocumented |
click.types.ParamType.to_info_dict
Gather information that could be useful for a tool generating user-facing documentation.
Use click.Context.to_info_dict
to traverse the entire
CLI structure.
Returns | |
t.Dict[ | Undocumented |