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:

_is_constrained()

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

__set_name__(_, name)[source]#

Create the name of the private instance variable that will hold the value.

Parameters:

name (str) –

Return type:

None

_is_constrained()[source]#

Return if this validation enforces any constraint.

Return type:

bool

validate(value)[source]#

Run all validators on this value.

Raise an exception if the provided value does not meet all of the required conditions enforced by this validator.

Parameters:

value (None | float) –

Return type:

None