Beispiel
pydantic 2.13.4: Update Pydantic 2.13.4 models without bypassing validation through model_copy or trusted existing instances
Verifiziertes Beispiel für pypi pydantic 2.13.4: Update Pydantic 2.13.4 models without bypassing validation through model_copy or trusted existing instances.…
sha256:a7f8bfd32813f975440d7e5007452b0320c4fef7237de0ea68ad49b75a676d7f
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 2
- Signaturschlüssel, die es gebaut haben
- 2
Deklarierte Umgebung
python 3.12 linux x64 python 3.12 python pip
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1 |
2026-08-17 |
| python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1 |
2026-08-18 |
Fall
HOW- Ziel
- Update Pydantic 2.13.4 models without bypassing validation through model_copy or trusted existing instances
- Pakete
- Symbole
-
- pydantic.BaseModel.model_copy
- pydantic.BaseModel.model_validate
- pydantic.ConfigDict.revalidate_instances
- pydantic.ConfigDict.validate_assignment
- pydantic.ValidationError
- Umgebung
- python 3.12
- Erstellt
- 2026-08-17T02:16:00Z
Contract
- model_copy(update=...) trusts update data: it neither coerces an invalid string amount nor enforces extra='forbid'.
- A model copied with an undeclared update exposes that attribute and marks it as set, while model_dump omits it and the original remains unchanged.
- Rebuilding from model_dump plus updates with model_validate rejects both the non-positive amount and the undeclared field, while valid strings are coerced to Decimal.
- With the default revalidate_instances='never', model_validate(existing_instance) returns the same instance and accepts an invalid post-construction assignment.
- revalidate_instances='always' rejects a previously damaged instance, while validate_assignment=True rejects invalid mutation immediately and coerces valid assignments.
Dateien
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- src/__init__.py
- src/models.py
- test/contract.py