pypi / pydantic
pydantic
What changed in pydantic 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
8 breaking5 new APIs and options2 performance1 behavior and defaults15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpydantic 231 changes
Breaking changes 8
Rejects out-of-range int inputs for timedelta.
Enum constructors are called in both validation modes.
Fraction validation rejects large exponents.
JSON Schema defaults are encoded with a consistent configuration.
multiple_of constraints must be positive.
NameEmail validation rejects newlines.
Python 3.9 is no longer supported.
Serialization inference no longer applies ser_json_timedelta to all datetime types.
New APIs and options 5
Supports
closedandextra_itemsvia inheritance in TypedDict.A counter core schema is added.
create_model() accepts a __namespace__ parameter.
The multiple_of constraint is supported in fraction and timedelta core schemas.
An ordered-dict core schema is added.
Performance 2
Avoids Python tuple allocation during model fields validation.
Avoids an unnecessary extra dict allocation in model validation.
Behavior and default changes 1
Supports named tuples in Sequence validation.
Fixes and other changes 15
Fixes the arguments-v3 schema when variadic keywords are present.
The Python Decimal validator now enforces the max_digits whole-digits limit.
Fixes a TypeError involving ForwardRef on Python 3.10.0.
OverflowError is caught during ByteSize validation.
Exceptions are handled during Decimal validation.
init and kw_only=False are propagated from Field() to stdlib dataclass fields.
Config propagation for stdlib dataclasses and TypedDicts in JSON Schema is fixed.
Propagated extra config is respected in the JSON Schema of stdlib dataclasses.
The model_config attribute is no longer mutated.
URL prefixes are no longer validated multiple times in multi host URLs.
Python 3.15 is now supported.
Incomplete types are rebuilt during serialization inference.
OS errors are handled during ZoneInfo validation.
Validated model fields are counted once in smart unions.
Validators can now be reused when plugins are set.