github pydantic/pydantic v2.4.0
v2.4.0 2023-09-25

latest releases: v2.10.0b2, v2.10.0b1, v1.10.19...
13 months ago

What's Changed

Packaging

New Features

Changes

Performance

  • Simplify flattening and inlining of CoreSchema by @adriangb in #7523
  • Remove unused copies in CoreSchema walking by @adriangb in #7528
  • Add caches for collecting definitions and invalid schemas from a CoreSchema by @adriangb in #7527
  • Eagerly resolve discriminated unions and cache cases where we can't by @adriangb in #7529
  • Replace dict.get and dict.setdefault with more verbose versions in CoreSchema building hot paths by @adriangb in #7536
  • Cache invalid CoreSchema discovery by @adriangb in #7535
  • Allow disabling CoreSchema validation for faster startup times by @adriangb in #7565

Fixes

  • Fix config detection for TypedDict from grandparent classes by @dmontagu in #7272
  • Fix hash function generation for frozen models with unusual MRO by @dmontagu in #7274
  • Make strict config overridable in field for Path by @hramezani in #7281
  • Use ser_json_<timedelta|bytes> on default in GenerateJsonSchema by @Kludex in #7269
  • Adding a check that alias is validated as an identifier for Python by @andree0 in #7319
  • Raise an error when computed field overrides field by @sydney-runkle in #7346
  • Fix applying SkipValidation to referenced schemas by @adriangb in #7381
  • Enforce behavior of private attributes having double leading underscore by @lig in #7265
  • Standardize __get_pydantic_core_schema__ signature by @hramezani in #7415
  • Fix generic dataclass fields mutation bug (when using TypeAdapter) by @sydney-runkle in #7435
  • Fix TypeError on model_validator in wrap mode by @pmmmwh in #7496
  • Improve enum error message by @hramezani in #7506
  • Make repr work for instances that failed initialization when handling ValidationErrors by @dmontagu in #7439
  • Fixed a regular expression denial of service issue by limiting whitespaces by @prodigysml in #7360
  • Fix handling of UUID values having UUID.version=None by @lig in #7566
  • Fix __iter__ returning private cached_property info by @sydney-runkle in #7570
  • Improvements to version info message by @samuelcolvin in #7594

New Contributors

Full Changelog: v2.3.0...v2.4.0

Don't miss a new pydantic release

NewReleases is sending notifications on new releases.