I'd like to accomplish an init of a list, containing default dicts, in turn containing lists.
What I have tried:
@dataclass
class MyClass:
self.b: int
cache: list = field(default_factory=list)
def __post_init__(self):
self.cache = [defaultdict(list) for _ in range(self.b)]
I'd appreciate help. Thank you.