Initializing and setting the self.typing_classes class variable
which contains typing classes and references to the corresponding
factory classes. The set of typing classes depend on the python minor
version.
| Parameters: |
-
typing_classes
(dict[object, ClassFactory], default:
TYPING_CLASSES
)
–
A collection of class types, by default TYPING_CLASSES
-
factory_classes
(FactoryClasses, default:
FACTORY_CLASSES
)
–
An instance of FactoryClasses which acts as a toolbox of Factory
classes, by default FACTORY_CLASSES
|
Source code in src/alpha/factories/model_class_factory.py
| def __init__(
self,
typing_classes: dict[object, ClassFactory] = TYPING_CLASSES,
factory_classes: FactoryClasses = FACTORY_CLASSES,
) -> None:
"""Initializing and setting the self.typing_classes class variable
which contains typing classes and references to the corresponding
factory classes. The set of typing classes depend on the python minor
version.
Parameters
----------
typing_classes
A collection of class types, by default TYPING_CLASSES
factory_classes
An instance of FactoryClasses which acts as a toolbox of Factory
classes, by default FACTORY_CLASSES
"""
self.typing_classes = typing_classes
self.factory_classes = factory_classes
# Set the model_class_factory reference in factory_classes to self if
# it is not already set
if self.factory_classes.model_class_factory is None:
self.factory_classes.model_class_factory = self # type: ignore
|