Why does the following
import json
from dataclasses import dataclass
@dataclass
class Foo(dict):
bar: Dict
example = Foo(bar={'spam': 'eggs'})
json.dumps(example)
yield an empty dict in json string form
'{}'
Note: I'm aware that this isn't a sensible struct, rather, just interested in the reason behind the result!