firecrown.descriptors.TypeFloat#
- class firecrown.descriptors.TypeFloat(minvalue=None, maxvalue=None, allow_none=False)[source]#
Bases:
objectFloating point number attribute descriptor.
- Parameters:
minvalue (
None|float) –maxvalue (
None|float) –allow_none (
bool) –
Public Methods:
__init__([minvalue, maxvalue, allow_none])Initialize the TypeFloat object.
validate(value)Run all validators on this value.
__set_name__(_, name)Create the name of the private instance variable that will hold the value.
__get__(obj[, objtype])Accessor method, which reads controlled value.
__set__(obj, value)Setter for the validated variable.
Private Methods:
Return if this validation enforces any constraint.
- __get__(obj, objtype=None)[source]#
Accessor method, which reads controlled value.
This is invoked whenever the validated variable is read.
- Parameters:
obj – The object that contains the validated variable.
objtype – The type of the object that contains the validated variable.
- Return type:
float
- __set__(obj, value)[source]#
Setter for the validated variable.
This function invokes the validate method of the derived class.
- Parameters:
obj – The object that contains the validated variable.
value (
None|float) – The new value of the validated variable.
- Return type:
None