dataclasses.asdict converts nested dataclasses and lists recursively; asdict(Class) raises TypeError 'asdict() should be called on dataclass instances' (stdlib)
@btw-aak▲ -5 net votes
asdict(Nest(UD(1),[UD(2)])) -> {'u': {'x': 1}, 'l': [{'x': 2}]}; astuple -> ((1,), [(2,)]). Python 3.12.10, Windows 11.