unstale

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 init

@unstale/cli 0.1.1 on npm

pydantic 231 changes

Breaking changes 8

  • Rejects out-of-range int inputs for timedelta.

    2.14.1release notes

  • Enum constructors are called in both validation modes.

    2.14.0release notes

  • Fraction validation rejects large exponents.

    2.14.0release notes

  • JSON Schema defaults are encoded with a consistent configuration.

    2.14.0release notes

  • multiple_of constraints must be positive.

    2.14.0release notes

  • NameEmail validation rejects newlines.

    2.14.0release notes

  • Python 3.9 is no longer supported.

    2.14.0release notes

  • Serialization inference no longer applies ser_json_timedelta to all datetime types.

    2.14.0release notes

New APIs and options 5

  • Supports closed and extra_items via inheritance in TypedDict.

    2.14.1release notes

  • A counter core schema is added.

    2.14.0release notes

  • create_model() accepts a __namespace__ parameter.

    2.14.0release notes

  • The multiple_of constraint is supported in fraction and timedelta core schemas.

    2.14.0release notes

  • An ordered-dict core schema is added.

    2.14.0release notes

Performance 2

  • Avoids Python tuple allocation during model fields validation.

    2.14.1release notes

  • Avoids an unnecessary extra dict allocation in model validation.

    2.14.1release notes

Behavior and default changes 1

Fixes and other changes 15

  • Fixes the arguments-v3 schema when variadic keywords are present.

    2.14.1release notes

  • The Python Decimal validator now enforces the max_digits whole-digits limit.

    2.14.1release notes

  • Fixes a TypeError involving ForwardRef on Python 3.10.0.

    2.14.1release notes

  • OverflowError is caught during ByteSize validation.

    2.14.0release notes

  • Exceptions are handled during Decimal validation.

    2.14.0release notes

  • init and kw_only=False are propagated from Field() to stdlib dataclass fields.

    2.14.0release notes

  • Config propagation for stdlib dataclasses and TypedDicts in JSON Schema is fixed.

    2.14.0release notes

  • Propagated extra config is respected in the JSON Schema of stdlib dataclasses.

    2.14.0release notes

  • The model_config attribute is no longer mutated.

    2.14.0release notes

  • URL prefixes are no longer validated multiple times in multi host URLs.

    2.14.0release notes

  • Python 3.15 is now supported.

    2.14.0release notes

  • Incomplete types are rebuilt during serialization inference.

    2.14.0release notes

  • OS errors are handled during ZoneInfo validation.

    2.14.0release notes

  • Validated model fields are counted once in smart unions.

    2.13.5release notes

  • Validators can now be reused when plugins are set.

    2.13.5release notes