refactor: Update config to use future annotations and move merge_dicts to misc.

This commit is contained in:
UpstreamData
2024-01-25 11:32:03 -07:00
parent c5eed797ec
commit b328a27f04
8 changed files with 64 additions and 55 deletions

View File

@@ -13,14 +13,15 @@
# See the License for the specific language governing permissions and -
# limitations under the License. -
# ------------------------------------------------------------------------------
from __future__ import annotations
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Union
class MinerConfigOption(Enum):
@classmethod
def from_dict(cls, dict_conf: Union[dict, None]):
def from_dict(cls, dict_conf: dict | None):
return cls.default()
def as_am_modern(self) -> dict:
@@ -67,7 +68,7 @@ class MinerConfigOption(Enum):
@dataclass
class MinerConfigValue:
@classmethod
def from_dict(cls, dict_conf: Union[dict, None]):
def from_dict(cls, dict_conf: dict | None):
return cls()
def as_dict(self) -> dict: