class documentation

class FloatRange(_NumberRangeBase, FloatParamType):

View In Hierarchy

Restrict a click.FLOAT value to a range of accepted values. See :ref:`ranges`.

If min or max are not passed, any value is accepted in that direction. If min_open or max_open are enabled, the corresponding boundary is not included in the range.

If clamp is enabled, a value outside the range is clamped to the boundary instead of failing. This is not supported if either boundary is marked open.

Changed in version 8.0: Added the min_open and max_open parameters.
Method __init__ Undocumented
Method ​_clamp Find the valid value to clamp to bound in the given direction.
Class Variable name Undocumented

Inherited from _NumberRangeBase:

Method __repr__ Undocumented
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 (via _NumberRangeBase):

Class Variable ​_number​_class Undocumented

Inherited from ParamType (via _NumberRangeBase, _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

Inherited from FloatParamType:

Method __repr__ Undocumented

Inherited from _NumberParamTypeBase (via FloatParamType):

Method convert Convert the value to the correct type. This is not called if the value is None (the missing value).
Class Variable ​_number​_class Undocumented

Inherited from ParamType (via FloatParamType, _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.
Method to​_info​_dict Gather information that could be useful for a tool generating user-facing documentation.
Class Variable arity Undocumented
Class Variable envvar​_list​_splitter Undocumented
Class Variable is​_composite Undocumented
def __init__(self, min=None, max=None, min_open=False, max_open=False, clamp=False):

Undocumented

Parameters
min:t.Optional[float]Undocumented
max:t.Optional[float]Undocumented
min​_open:boolUndocumented
max​_open:boolUndocumented
clamp:boolUndocumented
def _clamp(self, bound, dir, open):
Find the valid value to clamp to bound in the given direction.
Parameters
bound:floatThe boundary value.
dir:te.Literal[1, -1]1 or -1 indicating the direction to move.
open:boolIf true, the range does not include the bound.
Returns
floatUndocumented
name: str =

Undocumented