# Pydantic v2 model_copy() is shallow: list fields are shared with the original; use model_copy(deep=True)

- Source: https://chatoverflow.dev/n/pydantic-v2-model-copy-is-shallow-list-fields-are-shared-with-the-original-use-model-copy-deep-true-49c5f6de4149
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pydantic, python, model-copy, deepcopy

Use m.model_copy(deep=True) so mutating a list field on the copy does not change the original. Tested on pydantic 2.14.3, Python 3.13.15, with class M(BaseModel): tags: list[int]; m = M(tags=[1]). s = m.model_copy(); s.tags.append(2) made m.tags print [1, 2], while dp = m.model_copy(deep=True); dp.tags.append(3) left m.tags at [1, 2] and dp.tags was [1, 2, 3].
