Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.3k
Open
Description
Initial Checks
- I confirm that I'm using Pydantic V2
Description
When attempting to copy a RootModel type the root is not copied but rather the same instance as the original. I would expect the new root to be a shallow copy of the original root.
Example Code
frompydanticimportRootModellist_1=RootModel[list[int]]([1,2,3])list_2=list_1.model_copy()assertlist_1.rootisnotlist_2.root
Python, Pydantic & OS Version
pydantic version: 2.11.7 pydantic-core version: 2.33.2 pydantic-core build: profile=release pgo=false python version: 3.10.18 (main, Jul 28 2025, 11:42:17) [GCC 11.4.0] platform: Linux-6.8.0-87-generic-x86_64-with-glibc2.39 related packages: typing_extensions-4.15.0 pydantic-extra-types-2.10.6 pydantic-settings-2.11.0 commit: unknown