How to make a TypeVar (Generic) type in python with dataclass constraint?

Viewed 360

Is there a way to constraint some TypeVar to be dataclass? for example something like:

A = TypeVar('A', dataclass) # Wrong code!
0 Answers
Related