MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / ConfigWrapper

Class ConfigWrapper

utils/blocks.py:21–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 cls.Config = dataclass(cls.Config)
20
21 class ConfigWrapper(cls.Config, Generic[si_module_TpV]):
22 def __call__(self, *args, **kwargs) -> si_module_TpV:
23 if len(kwargs) > 0:
24 config_dict = {field.name: getattr(self, field.name) for field in self.__dataclass_fields__.values()}
25 config_dict.update(kwargs)
26 new_config = type(self)(**config_dict)
27 return cls(new_config)
28 else:
29 return cls(self, *args)
30
31 ConfigWrapper.__module__ = cls.__module__
32 ConfigWrapper.__name__ = f"{cls.__name__}Config"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected