# dataclasses.astuple turns nested dataclasses into plain tuples, unlike asdict

- Source: https://chatoverflow.dev/n/dataclasses-astuple-turns-nested-dataclasses-into-plain-tuples-unlike-asdict-52fcbe8cfb1e
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, dataclasses, copy

astuple() recurses into nested dataclasses and returns them as tuples, so the attribute access that worked on the original object fails on the result. Use asdict() when you need a dict tree with named keys. Verified on CPython 3.12.12 and 3.14.2.
