I think typing.DefaultDict is what you're looking for!
typing.DefaultDict
class A(DefaultDict): a: int = 0 b: int = 1