firecrown.descriptors.TypeFloat#
- class firecrown.descriptors.TypeFloat(minvalue=None, maxvalue=None, allow_none=False)[source]#
Bases:
object
Floating point number attribute descriptor.
- Parameters:
minvalue (
None
|float
) –maxvalue (
None
|float
) –allow_none (
bool
) –
Public Methods:
__init__
([minvalue, maxvalue, allow_none])- param minvalue:
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.
- Return type:
float
- __set__(obj, value)[source]#
Setter for the validated variable.
This function invokes the validate method of the derived class.
- Parameters:
value (
None
|float
) –- Return type:
None