refine code

This commit is contained in:
geekan 2024-01-09 17:52:34 +08:00 committed by 莘权 马
parent f4ae3bbfd9
commit 2ff2877536
2 changed files with 25 additions and 2 deletions

View file

@ -153,12 +153,13 @@ def merge_dict(dicts: Iterable[Dict]) -> Dict:
return result
class ConfigMixin:
class ConfigMixin(BaseModel):
"""Mixin class for configurable objects"""
_config: Optional[Config] = None
def __init__(self, config: Optional[Config] = None):
super().__init__()
self._config = config
def try_set_parent_config(self, parent_config):