diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b222e0..bd472d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Next version - Fix indentation of multi-line messages +- Stop using dataclass (for backwards compatibility with Python 3.6) ## 1.0.0 (2019-06-21) diff --git a/bowl/config.py b/bowl/config.py index a25f599..19fb1ec 100644 --- a/bowl/config.py +++ b/bowl/config.py @@ -1,4 +1,3 @@ -from dataclasses import dataclass, field from enum import Enum, auto from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple @@ -62,12 +61,17 @@ class Kind(Enum): Condition = Callable[[Any], bool] -@dataclass class Option: - kind: Kind - default: Any - conditions: Iterable[Tuple[Condition, str]] = field(default_factory=list) + def __init__(self, + kind: Kind, + default: Any, + conditions: Iterable[Tuple[Condition, str]] = frozenset(), + ) -> None: + + self.kind = kind + self.default = default + self.conditions = conditions def check_valid(self, value: Any) -> None: if not self.kind.matches(value):