| 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" |
nothing calls this directly
no outgoing calls
no test coverage detected