diplomat.processing.type_casters.RangedFloat
- class diplomat.processing.type_casters.RangedFloat(minimum: float, maximum: float)[source]
Bases:
ConvertibleTypeCasterRepresents a float with a restricted range of values it can take on.
- __init__(minimum: float, maximum: float)[source]
Create a ranged float, allowing values between minimum and maximum.
- Parameters:
minimum – The minimum value allowed for the float, inclusive.
maximum – The maximum value allowed for the float, inclusive.
Methods
__init__(minimum, maximum)Create a ranged float, allowing values between minimum and maximum.
Convert this type to a CLI-Friendly format for display on the command line as a metavar.
Abstract method: Convert this typecaster instance to a regular type hint.