Skip to content

v2.14.0b2 2026-09-09

Pre-release
Pre-release

Choose a tag to compare

@Viicos Viicos released this 08 Oct 14:38
· 210 commits to main since this release
6312eb1

What's Changed

This pre-release adds full support for Python 3.15 specific features, such as support for frozendict, making use of TypeForm and stabilizing the MISSING sentinel type.

New Features

  • Allow any CoreSchema to be used as serialization by @Viicos in #13680

  • Add support for frozendict type by @Viicos in #13634

  • Allow dict, frozendict and frozenset as defaultdict default factories by @Viicos in #13623

  • Add support for TypeForm by @Viicos in #13459.

    This adds support for static type checking where a type form is expected. For instance, type adapters:

    from pydantic import TypeAdapter
    
    ta = TypeAdapter(int | str)
    assert_type(ta.validate_python(1), int | str)
  • Add support for lazy imports by @Viicos in #13776

  • Stabilize MISSING sentinel by @Viicos in #13782.

    The MISSING sentinel is no longer experimental, and can be imported as from pydantic import MISSING.

Changes

Performance

  • Refactor type references logic by @Viicos in #13643
  • Improve performance of GenerateSchema.generate_schema() dispatching by @Viicos in #13614
  • Move schema gathering logic to pydantic-core by @Viicos in #13725
  • Improve performance of FieldInfo construction by @Viicos in #13726

Fixes

  • Fix support for callable discriminators with PEP 695 type aliases by @Viicos in #13604
  • Preserve re.Pattern instance for compiled patterns in the experimental pipeline by @soma0212 in #13611
  • Fix missing GC traversal on some pydantic-core struct fields by @Viicos in #13624
  • Fix missing GC traversal in pydantic-core for GeneralFieldsSerializer by @Viicos in #13629
  • Fix JSON schema discriminator mapping keys for bool discriminators by @remi-fongaufier in #13632
  • Fix application of other constraints in the pipeline API by @Viicos in #13659
  • Support bare None annotation for discriminated unions by @Viicos in #13667
  • Respect runtime alias validation configuration when wrap validators are present by @Viicos in #13668
  • Exclude computed fields with exclude_if from JSON Schema required fields by @Bishwas-py in #13563
  • Use config of TypeAdapter in JSON Schema generation by @Viicos in #13676
  • Support populate_by_name in @validate_call by @Viicos in #13691
  • Allow None to serialize against secret fields by @Viicos in #13699
  • Do not drop include/exclude if serializer wasn't called by @Viicos in #13702
  • Don't apply serialization temporal formats to validation JSON schemas by @MLuc24 in #13711
  • Reflect str_min_length and str_max_length config in the JSON schema by @MLuc24 in #13714
  • Treat a class attribute set to None as existing when assigning with extra='allow' by @Kropiunig in #13718
  • Use the field name in validation JSON schemas when validate_by_alias is False by @MLuc24 in #13717
  • Do not rely on normalization to validate decimals by @Viicos in #13742
  • Handle any exception when trying to compute JSON Schema default by @Viicos in #13741
  • Fix Mypy plugin crash with import cycle by @Viicos in #13767
  • Fix supported constraints for types of datetime module by @Viicos in #13768
  • Fix inconsistencies between constraints and core schemas allowed values by @Viicos in #13772
  • Allow self to be used as a parameter with @validate_call by @Viicos in #13773
  • Fix race conditions in freethreaded build by @Viicos in #13785

New Contributors

Full Changelog: v2.14.0a1...v2.14.0b2