firecrown.descriptors.Validator

class firecrown.descriptors.Validator[source]

Bases: ABC

Abstract base class for all validators.

The base class implements the methods required for setting values, which should not be overridden in derived classes.

Derived classes must implement the abstract method validate, which is called by the base class when any variable protected by a Validator is set.

Public Methods:

__set_name__(owner, 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.

validate(value)

Abstract method to perform whatever validation is required.


__get__(obj, objtype=None)[source]

Accessor method, which reads controlled value.

This is invoked whenever the validated variable is read.

__set__(obj, value)[source]

Setter for the validated variable.

This function invokes the validate method of the derived class.

__set_name__(owner, name)[source]

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

abstract validate(value)[source]

Abstract method to perform whatever validation is required.