I want to write a dataclass definition in Python, but can't refer to that same class inside the declaration.
Mainly what I want to achieve is the typing of this nested structure, as illustrated below:
@dataclass
class Category:
title: str
children: [Category] # I can't refer to a "Category"
tree = Category(title='title 1', children=[
Category('title 11', children=[]),
Category('title 12', children=[])
])