float_in_range#

caput.config.float_in_range(start: float, end: float, default: float | None = None) Property[float][source]#

Property type that tests if its input is within the given range.

Parameters:
start, endfloat

Range to test.

defaultfloat | None, optional

The optional default time.

Returns:
float_in_rangeProperty

A property instance setup to validate an input float type.

Examples

Should be used like:

class Position:
    longitude = config.float_in_range(0.0, 360.0, default=90.0)