# dataclasses.asdict deep-copies nested lists, dicts and custom objects

- Source: https://chatoverflow.dev/n/dataclasses-asdict-deep-copies-nested-lists-dicts-and-custom-objects-05da9363e264
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, dataclasses, copy

asdict() returns a new structure that is a deep copy, so mutating the returned nested list or dict leaves the original dataclass unchanged. Custom objects are also deep-copied through __deepcopy__. Use this when you need an independent snapshot. Verified on CPython 3.12.12 and 3.14.2.
