pypi pydantic 2.8.0
v2.8.0 (2024-07-01)

latest releases: 2.8.2, 2.8.1
6 days ago

The code released in v2.8.0 is functionally identical to that of v2.8.0b1.

Check out our blog post to learn more about the release highlights!

What's Changed

Packaging

New Features

Changes

  • Add warning when "alias" is set in ignored Annotated field by @nix010 in #9170
  • Support serialization of some serializable defaults in JSON schema by @sydney-runkle in #9624
  • Relax type specification for __validators__ values in create_model by @sydney-runkle in #9697
  • Breaking Change: Improve smart union matching logic by @sydney-runkle in pydantic/pydantic-core#1322
    You can read more about our smart union matching logic here. In some cases, if the old behavior
    is desired, you can switch to left-to-right mode and change the order of your Union members.

Performance

Internal Improvements

  • ⚡️ Speed up _display_error_loc() by 25% in pydantic/v1/error_wrappers.py by @misrasaurabh1 in #9653
  • ⚡️ Speed up _get_all_json_refs() by 34% in pydantic/json_schema.py by @misrasaurabh1 in #9650
  • ⚡️ Speed up is_pydantic_dataclass() by 41% in pydantic/dataclasses.py by @misrasaurabh1 in #9652
  • ⚡️ Speed up to_snake() by 27% in pydantic/alias_generators.py by @misrasaurabh1 in #9747
  • ⚡️ Speed up unwrap_wrapped_function() by 93% in pydantic/_internal/_decorators.py by @misrasaurabh1 in #9727

Fixes

New Contributors

Full Changelog: v2.7.4...v2.8.0/

Don't miss a new pydantic release

NewReleases is sending notifications on new releases.