objectstate.config
Framework configuration for pluggable base config type.
This module provides the configuration interface for the lazy configuration framework, allowing applications to specify their base configuration type.
The framework uses pure MRO-based resolution. The dual-axis resolution works by: 1. X-axis: Context flattening (Step → Pipeline → Global contexts merged) 2. Y-axis: MRO traversal (most specific → least specific class in inheritance chain)
You only need to call set_base_config_type() once at application startup.
Functions
Get the base configuration type. |
|
|
Set the base configuration type for the framework. |
- objectstate.config.set_base_config_type(config_type: Type) None[source]
Set the base configuration type for the framework.
This type is used as the root of the configuration hierarchy and should be the top-level configuration dataclass for your application.
- Parameters:
config_type – The base configuration dataclass type
Example
>>> from myapp.config import GlobalConfig >>> from objectstate.config import set_base_config_type >>> set_base_config_type(GlobalConfig)
- objectstate.config.get_base_config_type() Type[source]
Get the base configuration type.
- Returns:
The base configuration type
- Raises:
RuntimeError – If base config type has not been set