Converts the dataclass obj to a tuple (by using the factory function tuple_factory). Each dataclass is converted to a tuple of its field values. dataclasses, dicts, lists, and tuples are recursed into. Other objects are copied with copy.deepcopy().
dataclasses.astuple(obj, *, tuple_factory=tuple)
assert astuple(p) == (10, 20)
assert astuple(c) == ([(0, 0), (10, 4)],)
tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))