NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #18 most downloaded on PyPI
Data validation using Python type hints
Last release 25 days ago
09 Sep 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
9 years old
206 releases · first in 2017
This pre-release adds full support for Python 3.15 specific features, such as support for `frozendict`, making use of `TypeForm` and stabilizing the `
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.
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.
ser_json_temporal into account when generating JSON Schema by @shashiKundur1 in #13665__signature__ when validate_by_alias isFalse by @jaideeppyne in #13730deque core schema by @Viicos in #13757MISSING as a valid value in validation errors by @Viicos in #13779Decimal JSON Schema pattern constraint by @Viicos in #13672GenerateSchema.generate_schema() dispatching by @Viicos in #13614pydantic-core by @Viicos in #13725FieldInfo construction by @Viicos in #13726re.Pattern instance for compiled patterns in the experimental pipeline by @soma0212 in #13611pydantic-core struct fields by @Viicos in #13624pydantic-core for GeneralFieldsSerializer by @Viicos in #13629bool discriminators by @remi-fongaufier in #13632None annotation for discriminated unions by @Viicos in #13667exclude_if from JSON Schema required fields by @Bishwas-py in #13563TypeAdapter in JSON Schema generation by @Viicos in #13676populate_by_name in @validate_call by @Viicos in #13691None to serialize against secret fields by @Viicos in #13699str_min_length and str_max_length config in the JSON schema by @MLuc24 in #13714None as existing when assigning with extra='allow' by @Kropiunig in #13718validate_by_alias is False by @MLuc24 in #13717datetime module by @Viicos in #13768self to be used as a parameter with @validate_call by @Viicos in #13773One column per quarter.
This is the first beta release of the 2.14 version, providing some new features and performance improvements for model builds.
This is the first beta release of the 2.14 version, providing some new features and performance improvements for model builds.
This release is the first to provide initial support for Python 3.15, although not all 3.15 specific features are supported yet.
EllipsisType by @Viicos in #13484__slots__ from generic class during parameterization by @Viicos in #13243Any in the Mypy plugin by @Viicos in #13196Fraction type in pydantic-core by @Viicos in #13339SecretStr and SecretBytes types by @Viicos in #13518named-tuple core schema by @Viicos in #13505TypeError on invalid index_key serialization wrap handler by @Viicos in #13506ModelPrivateAttr.default_factory_takes_validated_data property by @Viicos in #13390Format.VALUE before FORWARDREF when evaluating annotations in ModelMetaclass by @Viicos in #13584gather_schemas_for_cleaning() by @dmontagu in #13523AliasGenerator outputs by @jiyujie2006 in #13248'definitions-ref' schemas in schema cleaning by @Viicos in #13276max_length check on lazy iteration validation by @davidhewitt in #13278WindowsPath as a schema type by @davidhewitt in #13326__pydantic_extra__ by @Viicos in #13391json_schema_extra dict being dropped when a callable follows it in Annotated by @Srivatsa03 in #13374RootModel.__init__() in Mypy plugin by @Viicos in #13441'seconds'/'milliseconds' temporal_mode by @Viicos in #13436Interval zero bounds silently dropped in pipeline API by @pctablet505 in #13452RootModel.model_dump() signature with its parent by @Viicos in #13456NotImplemented from URL ordering comparisons with foreign types by @chinesepowered in #13495SerializationInfo.exclude_computed_fields by @Viicos in #13560ValidateAs by @Viicos in #13487AllowInfNan type to the field metadata gathering by @mberdyshev in #13586Add PyEmscripten platform tag support by @Viicos, @greateggsgreg and @sinaatalay in #13199: pydantic-core now has a 3.14 wheel published with the `pye
pydantic-core now has a 3.14 wheel published with the pyemscripten_2026_0 platform tag.
Note that this wheel can only be used with Pyodide 314.0 and greater, still in development.
It is recommended to wait for the final 314.0 release (and for Pydantic to publish a new wheel in a future 2.14 release).None in MultiHostUrl.build()'s hosts parameter by @Viicos in #13068eval_type_backport() by @Viicos in #13133model_copy() by @connorcarpenter15 in #13087create_model() overload definition when __base__ is set to a type variable in the Mypy plugin by @cyphercodes in #13146Full Changelog: https://github.com/pydantic/pydantic/compare/v2.13.4...v2.14.0a1
Allow reuse of validators when plugins are set by @Viicos in #13535
pydantic-core struct fields by @Viicos in #13624pydantic-core for GeneralFieldsSerializer by @Viicos in #13629Bump libc from 0.2.155 to 0.2.185 by @Viicos in #13109
pydantic-core linker flags on macOS by @washingtoneg and @Viicos in #13147RootModel core metadata by @Viicos in #13129Full Changelog: https://github.com/pydantic/pydantic/compare/v2.13.3...v2.13.4
pydantic-core linker flags on macOS by @washingtoneg and @Viicos in #13147Full Changelog: v2.13.3...v2.13.4
Handle AttributeError subclasses with from_attributes by @Viicos in #13096
AttributeError subclasses with from_attributes by @Viicos in #13096Full Changelog: https://github.com/pydantic/pydantic/compare/v2.13.2...v2.13.3
Fix ValidationInfo.field_name missing with model_validate_json() by @Viicos in #13084
ValidationInfo.field_name missing with model_validate_json() by @Viicos in #13084Full Changelog: https://github.com/pydantic/pydantic/compare/v2.13.1...v2.13.2
ValidationInfo.field_name missing with model_validate_json() by @Viicos in #13084Fix ValidationInfo.data missing with model_validate_json() by @davidhewitt in #13079
ValidationInfo.data missing with model_validate_json() by @davidhewitt in #13079Full Changelog: https://github.com/pydantic/pydantic/compare/v2.13.0...v2.13.1
ValidationInfo.data missing with model_validate_json() by @davidhewitt in #13079The highlights of the v2.13 release are available in the blog post. Several minor changes (considered non-breaking changes according to our versioning…
The highlights of the v2.13 release are available in the blog post. Several minor changes (considered non-breaking changes according to our versioning policy) are also included in this release. Make sure to look into them before upgrading.
This release contains the updated pydantic.v1 namespace, matching version 1.10.26 which includes support for Python 3.14.
See the beta releases for all changes sinces 2.12.
Any when synthesizing _build_sources for BaseSettings.__init__() signature in the mypy plugin by @Viicos in #13049extra configuration by @Viicos in #13062Full Changelog: https://github.com/pydantic/pydantic/compare/v2.12.0...v2.13.0
<!-- Release notes generated using configuration in .github/release.yml at v2.13.0b3 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.13.0b3 -->
ascii_only option to StringConstraints by @ai-man-codes in #12907exclude_if in computed fields by @andresliszt in #12748MISSING sentinel by @Viicos in #12908model_fields_set by @navalprakhar in #12817extras_schema when only extra_fields_behavior is set on the config in JSON Schema generation for typed dictionaries by @Viicos in #12810__pydantic_private__ is set in model_construct() with user-defined model_post_init() by @nightcityblade in #12816InstanceOf by @Viicos in #12705create_model() to be used as annotations in the Mypy plugin by @Br1an67 in #12879PlaceholderNode in Mypy plugin by @Viicos in #12929MISSING during model serialization with exclude_unset by @davidhewitt in #12905__init__() is called when using model_validate_strings() by @siewcapital in #12897Full Changelog: https://github.com/pydantic/pydantic/compare/v2.13.0b2...v2.13.0b3
Fix backported V1 namespace by @Viicos in #12855
This is the first beta release of the 2.13 version, mainly providing bug fixes and performance improvements for validation and serialization.
This is the first beta release of the 2.13 version, mainly providing bug fixes and performance improvements for validation and serialization.
Notable changes include:
polymorphic_serialization option, solving issues with serialize_as_any introduced in 2.12.pydantic.v1 namespace. This version includes support for Python 3.14.pydantic-core repository was merged inside the main pydantic one.pydantic-core by @dependabot[bot] in #12508polymorphic_serialization option by @davidhewitt in #12518Literal root types as discriminator field types by @YassinNouh21 in #12680pydantic-core CI by @Viicos in #12752pydantic-core into pydantic by @davidhewitt in #12481complex() constructor unconditionally when validating complex Python data by @tanmaymunjal in #12498Decimal by @tanmaymunjal in #12500@field_serializer logic with @field_validator by @Viicos in #12577PydanticUserError a RuntimeError instead of a TypeError by @poliakovva in #12579root value when making root model shallow copies by @YassinNouh21 in #12679DecoratorInfos.build() implementation by @Viicos in #12536pydantic-core by @Viicos in #12549Literal validators by @davidhewitt in #12569LookupKey by @davidhewitt in #12571FieldInfo._copy() by @Viicos in #12727FieldInfo rebuilding when parameterizing generic models with an Annotated type by @Viicos in #12463InitVar being ignored when using with the pydantic.Field() function by @Viicos in #12495NamedTuple as values by @Viicos in #12506rebuild_dataclass() by @Viicos in #12513__pydantic_extra__ annotation handling by @Viicos in #12563MISSING sentinel is present in a nested model by @Viicos in #12635exclude_none is set by @davidhewitt in #12677field_definitions in create_model() by @lehmann-hqs in #12734kw_only with Field() by @jfadia in #12741typing.Union when replacing types under Python 3.14 by @Viicos in #12733This is the fifth 2.12 patch release, addressing an issue with the MISSING sentinel and providing several documentation improvements.
This is the fifth 2.12 patch release, addressing an issue with the MISSING sentinel and providing several documentation improvements.
The next 2.13 minor release will be published in a couple weeks, and will include a new polymorphic serialization feature addressing the remaining unexpected changes to the serialize as any behavior.
model_construct() on a model with MISSING as a default value by @ornariece in #12522.Full Changelog: https://github.com/pydantic/pydantic/compare/v2.12.4...v2.12.5
This is the fourth 2.12 patch release, fixing more regressions, and reverting a change in the build() method of the `AnyUrl` and Dsn types.
This is the fourth 2.12 patch release, fixing more regressions, and reverting a change in the build() method
of the AnyUrl and Dsn types.
This patch release also fixes an issue with the serialization of IP address types, when serialize_as_any is used. The next patch release
will try to address the remaining issues with serialize as any behavior by introducing a new polymorphic serialization feature, that
should be used in most cases in place of serialize as any.
Fix issue with forward references in parent TypedDict classes by @Viicos in #12427.
This issue is only relevant on Python 3.14 and greater.
Exclude fields with exclude_if from JSON Schema required fields by @Viicos in #12430
Revert URL percent-encoding of credentials in the build() method of the AnyUrl and Dsn types by @davidhewitt in pydantic-core#1833.
This was initially considered as a bugfix, but caused regressions and as such was fully reverted. The next release will include an opt-in option to percent-encode components of the URL.
Add type inference for IP address types by @davidhewitt in pydantic-core#1868.
The 2.12 changes to the serialize_as_any behavior made it so that IP address types could not properly serialize to JSON.
Avoid getting default values from defaultdict by @davidhewitt in pydantic-core#1853.
This fixes a subtle regression in the validation behavior of the collections.defaultdict
type.
Fix issue with field serializers on nested typed dictionaries by @davidhewitt in pydantic-core#1879.
Add more pydantic-core builds for the three-threaded version of Python 3.14 by @davidhewitt in pydantic-core#1864.
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.12.3...v2.12.4
…wasn't raised concistently. We decided to emit a deprecation warning instead.
This is the third 2.13 patch release, fixing issues related to the FieldInfo class, and reverting a change to the supported after model validator function signatures.
FieldInfo.asdict() method, improve documentation around FieldInfo by @Viicos in #12411.
This also adds back support for mutations on FieldInfo classes, that are reused as Annotated metadata. However, note that this is still not a supported pattern. Instead, please refer to the added example in the documentation.The blog post section on changes was also updated to document the changes related to serialize_as_any.
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.12.2...v2.12.3
Release a new pydantic-core version, as a corrupted CPython 3.10 manylinux2014_aarch64 wheel got uploaded (pydantic-core#1843).
pydantic-core version, as a corrupted CPython 3.10 manylinux2014_aarch64 wheel got uploaded (pydantic-core#1843).Full Changelog: https://github.com/pydantic/pydantic/compare/v2.12.1...v2.12.2
This is the first 2.12 patch release, addressing most (but not all yet) regressions from the initial 2.12.0 release.
This is the first 2.12 patch release, addressing most (but not all yet) regressions from the initial 2.12.0 release.
None is converted as NoneType in Python 3.14 by @Viicos in #12370ValidationInfo for validation of default value by @Viicos in pydantic-core#1826MultiHostUrl builder by @willswire in pydantic-core#1829serialize_as_any serialization flag by @davidhewitt in pydantic-core#1829RootModel serialization issues by @davidhewitt in pydantic-core#1836Full Changelog: https://github.com/pydantic/pydantic/compare/v2.12.0...v2.12.1
> Check out the blog post for release highlights. Several minor changes (considered non-breaking changes according to our versioning policy) are also…
<!-- Release notes generated using configuration in .github/release.yml at v2.12.0 -->
[!NOTE] Check out the blog post for release highlights. Several minor changes (considered non-breaking changes according to our versioning policy) are also included in this release. Make sure to look into them before upgrading.
[!WARNING] The core functionality of Pydantic V1 is not compatible with Python 3.14 or greater. This was fixed in v1.10.26.
This is the final 2.12 release. It features the work of 20 external contributors and provides useful new features, along with initial Python 3.14 support.
Changelog (see the 2.12.0a1 and 2.12.0b1 releases for additional changes since 2.11):
extra parameter to the validate functions by @anvilpete in #12233exclude_computed_fields serialization option by @Viicos in #12334preverse_empty_path URL options by @Viicos in #12336union_format parameter to JSON Schema generation by @Viicos in #12147__qualname__ parameter for create_model by @Atry in #12001TypeAdapter by @Viicos in #12324Any for context type annotation in TypeAdapter by @inducer in #12279FieldInfo in pydantic.fields.__all__ by @Viicos in #12339validation_alias in @validate_call by @Viicos in #12340Any as context annotation in plugin API by @Viicos in #12341stacklevel in warnings when possible by @Viicos in #12342Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.10...v2.12.0
This is the final 2.12 release. It features the work of 20 external contributors and provides useful new features, along with initial Python 3.14 support. Several minor changes (considered non-breaking changes according to our versioning policy) are also included in this release. Make sure to look into them before upgrading.
Note that Pydantic V1 is not compatible with Python 3.14 and greater.
See the beta releases for all changes sinces 2.11.
extra parameter to the validate functions by @anvilpete in #12233exclude_computed_fields serialization option by @Viicos in #12334preverse_empty_path URL options by @Viicos in #12336union_format parameter to JSON Schema generation by @Viicos in #12147__qualname__ parameter for create_model by @Atry in #12001TypeAdapter by @Viicos in #12324Any for context type annotation in TypeAdapter by @inducer in #12279FieldInfo in pydantic.fields.__all__ by @Viicos in #12339validation_alias in @validate_call by @Viicos in #12340Any as context annotation in plugin API by @Viicos in #12341stacklevel in warnings when possible by @Viicos in #12342This is the first beta release of the upcoming 2.12 release.
This is the first beta release of the upcoming 2.12 release.
pydantic-core to v2.40.1 by @Viicos in #12314exclude_if at the field level by @andresliszt in #12141ValidateAs annotation helper by @Viicos in #11942pydantic-core version is installed by @Viicos in #12196__getattr__() behavior on Pydantic models when a property raised an AttributeError and extra values are present by @raspuchin in #12106validate_assignment set by @Viicos in #12173ImportString JSON serialization for objects with a name attribute by @chr1sj0nes in #12219Do not use deprecated methods as default field values by @Viicos in #11914
This is the first alpha release of the upcoming 2.12 release, which adds initial support for Python 3.14.
__pydantic_on_complete__() hook that is called once model is fully ready to be used by @DouweM in #11762Decimal type by @Dima-Bulavenko in #11987doc attribute on dataclass fields by @Viicos in #12077MISSING sentinel by @Viicos in #11883create_model() by @Viicos in #11714GenerateSchema class by @Viicos in #11733inspect.getsourcelines() for docstring extraction on Python 3.13 and greater by @Viicos in #11829FieldInfo creation implementation by @Viicos in #11898Secret covariant by @bluenote10 in #12008field_name in validator core schemas by @DouweM in #11761validate_assignment can be unpickled by @Viicos in #11769function-before schemas during schema gathering by @Viicos in #11801FieldInfo is complete after applying type variable map by @Viicos in #11855model_rebuild() by @Viicos in #11890FieldInfo by @Viicos in #11946SkipValidation by @ygsh0816 in #12002Field() default with validate_default set to True by @Viicos in #11988Field() function in dataclasses by @Viicos in #12051mkdocs-llmstxt to v0.2.0 by @Viicos in #11725pydantic-core to v2.35.1 by @Viicos in #11963Backport v1.10.24 changes by @Viicos
Backport v1.10.23 changes by @Viicos
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.8...v2.11.9
Fix mypy plugin for mypy 1.18 by @cdce8p in #12209
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.7...v2.11.8
<!-- Release notes generated using configuration in .github/release.yml at v2.11.7 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.11.7 -->
FieldInfo instance if necessary during FieldInfo build by @Viicos in https://github.com/pydantic/pydantic/pull/11980Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.6...v2.11.7
FieldInfo instance if necessary during FieldInfo build by @Viicos in #11898Rebuild dataclass fields before schema generation by @Viicos in #11949
<!-- Release notes generated using configuration in .github/release.yml at v2.11.5 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.11.5 -->
FieldInfo is complete after applying type variable map by @Viicos in #11855model_rebuild() by @Viicos in #11890Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.4...v2.11.5
Bump mkdocs-llmstxt to v0.2.0 by @Viicos in #11725
mkdocs-llmstxt to v0.2.0 by @Viicos in #11725create_model() by @Viicos in #11714.
This change was backported as it was previously possible (although not meant to be supported)
to provide model_config as a field, which would make it possible to provide both configuration
and bases.function-before schemas during schema gathering by @Viicos in #11801<!-- Release notes generated using configuration in .github/release.yml at v2.11.3 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.11.3 -->
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.2...v2.11.3
Mention the attribute name in model fields deprecation message by @Viicos in https://github.com/pydantic/pydantic/pull/11674
<!-- Release notes generated using configuration in .github/release.yml at v2.11.2 -->
pydantic-core to v2.33.1 by @Viicos in https://github.com/pydantic/pydantic/pull/11678__pydantic_private__ exists before setting private attributes by @Viicos in https://github.com/pydantic/pydantic/pull/11666FieldInfo._complete when using field from parent class by @Viicos in https://github.com/pydantic/pydantic/pull/11668Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.1...v2.11.2
pydantic-core to v2.33.1 by @Viicos in #11678__pydantic_private__ exists before setting private attributes by @Viicos in #11666FieldInfo._complete when using field from parent class by @Viicos in #11668<!-- Release notes generated using configuration in .github/release.yml at v2.11.1 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.11.1 -->
'definitions-ref' schemas containing serialization schemas or metadata by @Viicos in https://github.com/pydantic/pydantic/pull/11644Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.0...v2.11.1
'definitions-ref' schemas containing serialization schemas or metadata by @Viicos in #11644Raise a deprecation warning when a field is annotated as final with a default value by @Viicos in https://github.com/pydantic/pydantic/pull/11168
<!-- Release notes generated using configuration in .github/release.yml at v2.11.0 -->
check_pydantic_core_version() function by @Viicos in https://github.com/pydantic/pydantic/pull/11324greenlet development dependency by @Viicos in https://github.com/pydantic/pydantic/pull/11351pydantic-core to v2.32.0 by @Viicos in https://github.com/pydantic/pydantic/pull/11567default_factory_takes_validated_data property to FieldInfo by @Viicos in https://github.com/pydantic/pydantic/pull/11034type[] by @Viicos in https://github.com/pydantic/pydantic/pull/11088encoded_string() method to the URL types by @YassinNouh21 in https://github.com/pydantic/pydantic/pull/11580defer_build with @validate_call decorator by @Viicos in https://github.com/pydantic/pydantic/pull/11584@with_config decorator to be used with keyword arguments by @Viicos in https://github.com/pydantic/pydantic/pull/11608generate_arguments_schema() function by @Viicos in https://github.com/pydantic/pydantic/pull/11572create_model field definitions format by @Viicos in https://github.com/pydantic/pydantic/pull/11032model_fields and model_computed_fields on instances by @Viicos in https://github.com/pydantic/pydantic/pull/11169GenerateSchema class by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10846Mapping schema gen to GenerateSchema to complete removal of prepare_annotations_for_known_type workaround by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11247get_type_ref by @Viicos in https://github.com/pydantic/pydantic/pull/10863pydantic-core core schema validation by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11271FieldInfo annotations if required during schema building by @Viicos in https://github.com/pydantic/pydantic/pull/10769__setattr__ performance of Pydantic models by caching setter functions by @MarkusSintonen in https://github.com/pydantic/pydantic/pull/10868_typing_extra module by @Viicos in https://github.com/pydantic/pydantic/pull/11255CoreConfig instance by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11384_internal/_validators.py by @tkasuz in https://github.com/pydantic/pydantic/pull/10763AnyUrl to preserve behavior from v2.9 by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10856TypeAdapter instance repr by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10872TypeAdapter by @Viicos in https://github.com/pydantic/pydantic/pull/10893model_fields and model_computed_fields by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10911'' by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10936Secret types and Url types by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10947Field.default to be compatible with Python 3.8 and 3.9 by @Viicos in https://github.com/pydantic/pydantic/pull/10972BaseModel.__replace__ definition from type checkers by @Viicos in https://github.com/pydantic/pydantic/pull/10979defer_build is set on Pydantic dataclasses by @Viicos in https://github.com/pydantic/pydantic/pull/10984dict core schema keys by @Viicos in https://github.com/pydantic/pydantic/pull/10989PlainSerializer and WrapSerializer functions by @Viicos in https://github.com/pydantic/pydantic/pull/11008serialization mode by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11035Literal values if using PEP 695 type aliases by @Viicos in https://github.com/pydantic/pydantic/pull/11114__subclasscheck__ on ModelMetaclass to avoid memory leak and performance issues by @Viicos in https://github.com/pydantic/pydantic/pull/11116len to _BaseUrl to avoid TypeError by @Kharianne in https://github.com/pydantic/pydantic/pull/11111Annotated form by @Viicos in https://github.com/pydantic/pydantic/pull/11109WithJsonSchema schema to avoid sharing mutated data by @thejcannon in https://github.com/pydantic/pydantic/pull/11014CoreMetadata definition by @Viicos in https://github.com/pydantic/pydantic/pull/11216_Definitions class by @Viicos in https://github.com/pydantic/pydantic/pull/11208root type in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11212deque schema gen to GenerateSchema class by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11239use_attribute_docstrings by @Viicos in https://github.com/pydantic/pydantic/pull/11246decimal_places_validator by @misrasaurabh1 in https://github.com/pydantic/pydantic/pull/11281validation_alias in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11295"examples" keys by @Viicos in https://github.com/pydantic/pydantic/pull/11305ClickHouseDsn by @Maze21127 in https://github.com/pydantic/pydantic/pull/11319Decimal instances by @Viicos in https://github.com/pydantic/pydantic/pull/11350examples keys by @Viicos in https://github.com/pydantic/pydantic/pull/11366additionalProperties: True for arbitrary dictionary schemas by @austinyu in https://github.com/pydantic/pydantic/pull/11392fallback parameter in serialization methods by @Viicos in https://github.com/pydantic/pydantic/pull/11398Sequence types by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11435__get_validators__ on classes where __get_pydantic_core_schema__ is also defined by @tlambert03 in https://github.com/pydantic/pydantic/pull/11444langchain third party tests by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11474validate_by_name to True when validate_by_alias is False by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11503Any when synthesizing BaseSettings.__init__ signature in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11497typing-inspection library by @Viicos in https://github.com/pydantic/pydantic/pull/11479NotRequired qualifier not taken into account in stringified annotation by @Viicos in https://github.com/pydantic/pydantic/pull/11559Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.6...v2.11.0
Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general). See the blog post for more details.
encoded_string() method to the URL types by @YassinNouh21 in #11580defer_build with @validate_call decorator by @Viicos in #11584@with_config decorator to be used with keyword arguments by @Viicos in #11608generate_arguments_schema() function by @Viicos in #11572pydantic-core to v2.33.0 by @Viicos in #11631<!-- Release notes generated using configuration in .github/release.yml at v2.11.0b2 -->
<!-- Release notes generated using configuration in .github/release.yml at v2.11.0b2 -->
pydantic-core to v2.32.0 by @Viicos in https://github.com/pydantic/pydantic/pull/11567NotRequired qualifier not taken into account in stringified annotation by @Viicos in https://github.com/pydantic/pydantic/pull/11559Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.0b1...v2.11.0b2
NotRequired qualifier not taken into account in stringified annotation by @Viicos in #11559pydantic-core to v2.32.0 by @Viicos in #11567Breaking Change: Move core schema generation logic for path types inside the GenerateSchema class by @sydney-runkle in https://github.com/pydantic/pyd…
[!NOTE]
Addendum: 2.11 introduced a small behavior change withFinalattributes with an underscore:class Model(BaseModel): _var: Final[int] = 1In 2.10,
_varwould be considered as a class variable, but as a private attribute in 2.11. As documented in the blog post, you can make use ofClassVarinstead ofFinalto keep it as a class variable.
check_pydantic_core_version() function by @Viicos in https://github.com/pydantic/pydantic/pull/11324greenlet development dependency by @Viicos in https://github.com/pydantic/pydantic/pull/11351typing-inspection library by @Viicos in https://github.com/pydantic/pydantic/pull/11479pydantic-core to v2.31.1 by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11526default_factory_takes_validated_data property to FieldInfo by @Viicos in https://github.com/pydantic/pydantic/pull/11034type[] by @Viicos in https://github.com/pydantic/pydantic/pull/11088create_model field definitions format by @Viicos in https://github.com/pydantic/pydantic/pull/11032model_fields and model_computed_fields on instances by @Viicos in https://github.com/pydantic/pydantic/pull/11169GenerateSchema class by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10846get_type_ref by @Viicos in https://github.com/pydantic/pydantic/pull/10863pydantic-core core schema validation by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11271FieldInfo annotations if required during schema building by @Viicos in https://github.com/pydantic/pydantic/pull/10769__setattr__ performance of Pydantic models by caching setter functions by @MarkusSintonen in https://github.com/pydantic/pydantic/pull/10868_typing_extra module by @Viicos in https://github.com/pydantic/pydantic/pull/11255CoreConfig instance by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11384pydantic-core and thus use SchemaValidator and SchemaSerializer caching by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11402TypeAdapter instance repr by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10872TypeAdapter by @Viicos in https://github.com/pydantic/pydantic/pull/10893Literal values if using PEP 695 type aliases by @Viicos in https://github.com/pydantic/pydantic/pull/11114__subclasscheck__ on ModelMetaclass to avoid memory leak and performance issues by @Viicos in https://github.com/pydantic/pydantic/pull/11116_extract_get_pydantic_json_schema() parameter by @Viicos in https://github.com/pydantic/pydantic/pull/11155Annotated form by @Viicos in https://github.com/pydantic/pydantic/pull/11109deprecated_instance_property warning by @Viicos in https://github.com/pydantic/pydantic/pull/11200WithJsonSchema schema to avoid sharing mutated data by @thejcannon in https://github.com/pydantic/pydantic/pull/11014CoreMetadata definition by @Viicos in https://github.com/pydantic/pydantic/pull/11216_Definitions class by @Viicos in https://github.com/pydantic/pydantic/pull/11208root type in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11212use_attribute_docstrings by @Viicos in https://github.com/pydantic/pydantic/pull/11246decimal_places_validator by @misrasaurabh1 in https://github.com/pydantic/pydantic/pull/11281validation_alias in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11295"examples" keys by @Viicos in https://github.com/pydantic/pydantic/pull/11305GenerateJsonSchema.literal_schema() implementation by @misrasaurabh1 in https://github.com/pydantic/pydantic/pull/11321ClickHouseDsn by @Maze21127 in https://github.com/pydantic/pydantic/pull/11319Decimal instances by @Viicos in https://github.com/pydantic/pydantic/pull/11350additionalProperties: True for arbitrary dictionary schemas by @austinyu in https://github.com/pydantic/pydantic/pull/11392fallback parameter in serialization methods by @Viicos in https://github.com/pydantic/pydantic/pull/11398Sequence types by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11435__get_validators__ on classes where __get_pydantic_core_schema__ is also defined by @tlambert03 in https://github.com/pydantic/pydantic/pull/11444validate_by_name to True when validate_by_alias is False by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11503Any when synthesizing BaseSettings.__init__ signature in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11497ValueError on year zero by @davidhewitt in https://github.com/pydantic/pydantic-core/pull/1583dataclass InitVar shouldn't be required on serialization by @sydney-runkle in https://github.com/pydantic/pydantic-core/pull/1602Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.6...v2.11.0b1
> Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general).
[!NOTE] Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general). This is another early alpha release, meant to collect early feedback from users having issues with core schema builds.
pydantic-core to v2.29.0 by @mikeedjones in https://github.com/pydantic/pydantic/pull/11402CoreConfig instance by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11384examples keys by @Viicos in https://github.com/pydantic/pydantic/pull/11366additionalProperties: True for arbitrary dictionary schemas by @austinyu in https://github.com/pydantic/pydantic/pull/11392fallback parameter in serialization methods by @Viicos in https://github.com/pydantic/pydantic/pull/11398Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.0a1...v2.11.0a2
Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general). This is another early alpha release, meant to collect early feedback from users having issues with core schema builds.
CoreConfig instance by @sydney-runkle in #11384examples keys by @Viicos in #11366additionalProperties: True for arbitrary dictionary schemas by @austinyu in #11392fallback parameter in serialization methods by @Viicos in #11398ruff from 0.9.2 to 0.9.5 by @Viicos in #11407pydantic-core to v2.29.0 by @mikeedjones in #11402Raise a deprecation warning when a field is annotated as final with a default value by @Viicos in #11168
[!NOTE]
Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general). This is an early alpha release, meant to collect early feedback from users having issues with core schema builds.
ruff to v0.9.0 by @sydney-runkle in #11254uv.lock deps update by @sydney-runkle in #11333check_pydantic_core_version() function by @Viicos in #11324greenlet development dependency by @Viicos in #11351pydantic-core to v2.28.0 by @Viicos in #11364default_factory_takes_validated_data property to FieldInfo by @Viicos in #11034type[] by @Viicos in #11088create_model field definitions format by @Viicos in #11032model_fields and model_computed_fields on instances by @Viicos in #11169GenerateSchema class by @sydney-runkle in #10846deque schema gen to GenerateSchema class by @sydney-runkle in #11239Mapping schema gen to GenerateSchema to complete removal of prepare_annotations_for_known_type workaround by @sydney-runkle in #11247pydantic-core core schema validation by @sydney-runkle in #11271FieldInfo annotations if required during schema building by @Viicos in #10769get_type_ref by @Viicos in #10863__setattr__ performance of Pydantic models by caching setter functions by @MarkusSintonen in #10868_typing_extra module by @Viicos in #11255_internal/_validators.py by @tkasuz in #10763TypeAdapter instance repr by @sydney-runkle in #10872Literal values if using PEP 695 type aliases by @Viicos in #11114__subclasscheck__ on ModelMetaclass to avoid memory leak and performance issues by @Viicos in #11116_extract_get_pydantic_json_schema() parameter by @Viicos in #11155Annotated form by @Viicos in #11109openapi-python-client check in issue creation for third-party failures, use main branch by @sydney-runkle in #11182deprecated_instance_property warning by @Viicos in #11200WithJsonSchema schema to avoid sharing mutated data by @thejcannon in #11014CoreMetadata definition by @Viicos in #11216_Definitions class by @Viicos in #11208root type in the mypy plugin by @Viicos in #11212use_attribute_docstrings by @Viicos in #11246decimal_places_validator by @misrasaurabh1 in #11281validation_alias in the mypy plugin by @Viicos in #11295GenerateJsonSchema.literal_schema() implementation by @misrasaurabh1 in #11321ClickHouseDsn by @Maze21127 in #11319Decimal instances by @Viicos in #11350ValueError on year zero by @davidhewitt in pydantic-core#1583Fix JSON Schema reference collection with 'examples' keys by @Viicos in #11325
Remove custom MRO implementation of Pydantic models by @Viicos in #11184
Bump pydantic-core to v2.27.2 by @davidhewitt in #11138
pydantic-core to v2.27.2 by @davidhewitt in #11138AnyUrl objects by @alexprabhat99 in #11082len to _BaseUrl to avoid TypeError by @Kharianne in #11111Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.3...v2.10.4
AnyUrl objects by @alexprabhat99 in #11082len to _BaseUrl to avoid TypeError by @Kharianne in #11111pydantic-core to v2.27.2 by @davidhewitt in #11138Set fields when defer_build is set on Pydantic dataclasses by @Viicos in #10984
defer_build is set on Pydantic dataclasses by @Viicos in #10984dict core schema keys by @Viicos in #10989PlainSerializer and WrapSerializer functions by @Viicos in #11008default_factory_takes_validated_data property to FieldInfo by @Viicos in #11034serialization mode by @sydney-runkle in #11035Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.2...v2.10.3
Only evaluate FieldInfo annotations if required during schema building by @Viicos in #10769
FieldInfo annotations if required during schema building by @Viicos in #10769Secret types and Url types by @sydney-runkle in #10947Field.default to be compatible with Python 3.8 and 3.9 by @Viicos in #10972BaseModel.__replace__ definition from type checkers by @Viicos in 10979Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.1...v2.10.2
Bump pydantic-core version to v2.27.1 by @sydney-runkle in #10938
pydantic-core version to v2.27.1 by @sydney-runkle in #10938TypeAdapter by @Viicos in #10893default_factory utils by @sydney-runkle in #10909model_fields and model_computed_fields by @sydney-runkle in #10911dataclasses by @sydney-runkle in #10928globals of the function when evaluating the return type of serializers and computed_fields by @Viicos in #10929'' by @sydney-runkle in #10936python mode serialization for complex inference by @sydney-runkle in pydantic-core#1549Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.0...v2.10.1
Fix class access of deprecated computed_fields by @Viicos in #10391
The code released in v2.10.0 is practically identical to that of v2.10.0b2. See the v2.10 release blog post for the highlights!
pydantic-core to v2.27.0 by @sydney-runkle in #10825fractions.Fraction by @sydney-runkle in #10318Hashable for json validation by @sydney-runkle in #10324SocketPath type for linux systems by @theunkn0wn1 in #10378examples by @sydney-runkle in #10417defer_build for Pydantic dataclasses by @Viicos in #10313TypedDict to type hint variadic keyword arguments with @validate_call by @Viicos in #10416protected_namespaces by @sydney-runkle in #10522propertyNames in JSON schema by @FlorianSW in #10478__replace__ protocol for Python 3.13+ support by @sydney-runkle in #10596sort method for JSON schema generation by @sydney-runkle in #10595@validate_call callable argument by @kc0506 in #10627experimental_allow_partial support by @samuelcolvin in #10748ValidationError and PydanticCustomError by @Youssefares in pydantic/pydantic-core#1413trailing-strings support to experimental_allow_partial by @sydney-runkle in #10825rebuild() method for TypeAdapter and simplify defer_build patterns by @sydney-runkle in #10537TypeAdapter instance repr by @sydney-runkle in #10872SchemaGenerator until interface is more stable by @sydney-runkle in #10303defer_build on TypeAdapters, removing experimental flag by @sydney-runkle in #10329mro of generic subclass by @kc0506 in #10100b64decode and b64encode for Base64Bytes type by @sydney-runkle in #10486@dataclass decorator and with the __pydantic_config__ attribute by @sydney-runkle in #10406Ellipsis (...) with Field by @Viicos in #10661Literals and Enums by @Viicos in #10692Any or Never when replacing type variables by @Viicos in #10338base64 bytes by @bschoenmaeckers in pydantic/pydantic-core#1448CoreMetadata refactor with an emphasis on documentation, schema build time performance, and reducing complexity by @sydney-runkle in #10675computed_field with field_serializer by @nix010 in #10390Predicate issue in v2.9.0 by @sydney-runkle in #10321annotated-types bound by @sydney-runkle in #10327tzdata install requirement into optional timezone dependency by @jakob-keller in #10331namedtuple core schemas by @Viicos in #10337IncEx type alias definition by @Viicos in #10339ModelMetaclass.mro by @Viicos in #10372computed_fields by @Viicos in #10391inspect.iscoroutinefunction works on coroutines decorated with @validate_call by @MovisLi in #10374NameError when using validate_call with PEP 695 on a class by @kc0506 in #10380ZoneInfo with various invalid types by @sydney-runkle in #10408PydanticUserError on empty model_config with annotations by @cdwilson in #10412_IncEx type alias, only allow True by @Viicos in #10414PlainValidator by @Viicos in #10427json_schema_input_type by @Viicos in #10439Representation by @Viicos in #10480max_digits and decimal_places) by @sydney-runkle in #10506__pydantic_core_schema__ from the current class during schema generation by @Viicos in #10518stacklevel on deprecation warnings for BaseModel by @sydney-runkle in #10520stacklevel in BaseModel.__init__ by @Viicos in #10526ConfigWrapper.core_config to take the title directly by @Viicos in #10562mode='python' by @sydney-runkle in #10594Base64Etc types by @sydney-runkle in #10584validate_call ignoring Field in Annotated by @kc0506 in #10610Self is invalid by @kc0506 in #10609core_schema.InvalidSchema instead of metadata injection + checks by @sydney-runkle in #10523type with typing.Self and type aliases by @kc0506 in #10621Field and PrivateAttr functions by @Viicos in #10651mypy plugin implementation by @Viicos in #10669typing_extensions variant of TypeAliasType by @Daraan in #10713BaseModel.model_copy() by @Viicos in #10751isinstance behavior for urls by @sydney-runkle in #10766cached_property can be set on Pydantic models by @Viicos in #10774host_required for URLs by @Viicos in pydantic/pydantic-core#1488coerce_numbers_to_str enabled and string has invalid Unicode character by @andrey-berenda in pydantic/pydantic-core#1515complex values in Enums by @changhc in pydantic/pydantic-core#1524_typing_extra module by @Viicos in #10725bytearray to TypeAdapter.validate_json signature by @samuelcolvin in #10802Field by @Viicos in #10816validate_call by @sydney-runkle in #10807IncEx type alias to be compatible with mypy by @Viicos in #10813__signature__ a lazy property, do not deepcopy defaults by @Viicos in #10818__signature__ lazy for dataclasses, too by @sydney-runkle in #10832AnyUrl to preserve behavior from v2.9 by @sydney-runkle in #10856Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.2...v2.10.0
Replaced pdm with uv by @frfahim in #10727
trailing-strings support to experimental_allow_partial by @sydney-runkle in #10825rebuild() method for TypeAdapter and simplify defer_build patterns by @sydney-runkle in #10537_typing_extra module by @Viicos in #10725bytearray to TypeAdapter.validate_json signature by @samuelcolvin in #10802Field by @Viicos in #10816validate_call by @sydney-runkle in #10807IncEx type alias to be compatible with mypy by @Viicos in #10813__signature__ a lazy property, do not deepcopy defaults by @Viicos in #10818__signature__ lazy for dataclasses, too by @sydney-runkle in #10832Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.0b1...v2.10.0b2
Fix class access of deprecated computed_fields by @Viicos in #10391
pydantic-core to v2.26.0 by @samuelcolvin in #10748fractions.Fraction by @sydney-runkle in #10318Hashable for json validation by @sydney-runkle in #10324SocketPath type for linux systems by @theunkn0wn1 in #10378examples by @sydney-runkle in #10417defer_build for Pydantic dataclasses by @Viicos in #10313TypedDict to type hint variadic keyword arguments with @validate_call by @Viicos in #10416protected_namespaces by @sydney-runkle in #10522propertyNames in JSON schema by @FlorianSW in #10478__replace__ protocol for Python 3.13+ support by @sydney-runkle in #10596sort method for JSON schema generation by @sydney-runkle in #10595@validate_call callable argument by @kc0506 in #10627experimental_allow_partial support by @samuelcolvin in #10748ValidationError and PydanticCustomError by @Youssefares in pydantic/pydantic-core#1413 - see release blog post for usage details.SchemaGenerator until interface is more stable by @sydney-runkle in #10303defer_build on TypeAdapters, removing experimental flag by @sydney-runkle in #10329mro of generic subclass by @kc0506 in #10100b64decode and b64encode for Base64Bytes type by @sydney-runkle in #10486@dataclass decorator and with the __pydantic_config__ attribute by @sydney-runkle in #10406Ellipsis (...) with Field by @Viicos in #10661Literals and Enums by @Viicos in #10692Any or Never when replacing type variables by @Viicos in #10338base64 bytes by @bschoenmaeckers in pydantic/pydantic-core#1448CoreMetadata refactor with an emphasis on documentation, schema build time performance, and reducing complexity by @sydney-runkle in #10675computed_field with field_serializer by @nix010 in #10390Predicate issue in v2.9.0 by @sydney-runkle in #10321annotated-types bound by @sydney-runkle in #10327tzdata install requirement into optional timezone dependency by @jakob-keller in #10331namedtuple core schemas by @Viicos in #10337IncEx type alias definition by @Viicos in #10339ModelMetaclass.mro by @Viicos in #10372computed_fields by @Viicos in #10391inspect.iscoroutinefunction works on coroutines decorated with @validate_call by @MovisLi in #10374NameError when using validate_call with PEP 695 on a class by @kc0506 in #10380ZoneInfo with various invalid types by @sydney-runkle in #10408PydanticUserError on empty model_config with annotations by @cdwilson in #10412_IncEx type alias, only allow True by @Viicos in #10414PlainValidator by @Viicos in #10427json_schema_input_type by @Viicos in #10439Representation by @Viicos in #10480max_digits and decimal_places) by @sydney-runkle in #10506__pydantic_core_schema__ from the current class during schema generation by @Viicos in #10518stacklevel on deprecation warnings for BaseModel by @sydney-runkle in #10520stacklevel in BaseModel.__init__ by @Viicos in #10526ConfigWrapper.core_config to take the title directly by @Viicos in #10562mode='python' by @sydney-runkle in #10594Base64Etc types by @sydney-runkle in #10584validate_call ignoring Field in Annotated by @kc0506 in #10610Self is invalid by @kc0506 in #10609core_schema.InvalidSchema instead of metadata injection + checks by @sydney-runkle in #10523type with typing.Self and type aliases by @kc0506 in #10621Field and PrivateAttr functions by @Viicos in #10651mypy plugin implementation by @Viicos in #10669typing_extensions variant of TypeAliasType by @Daraan in #10713BaseModel.model_copy() by @Viicos in #10751isinstance behavior for urls by @sydney-runkle in #10766cached_property can be set on Pydantic models by @Viicos in #10774host_required for URLs by @Viicos in pydantic/pydantic-core#1488coerce_numbers_to_str enabled and string has invalid Unicode character by @andrey-berenda in pydantic/pydantic-core#1515complex values in Enums by @changhc in pydantic/pydantic-core#1524Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.2...v2.10.0b1
Pre-release, see the GitHub release for details.
<!-- package description limit -->
Do not error when trying to evaluate annotations of private attributes by @Viicos in #10358
Callable discriminators by @sydney-runkle in #10400PlainValidator by @Viicos in #10427Union serialization warnings by @sydney-runkle in pydantic/pydantic-core#1449_IncEx type alias, only allow True by @Viicos in #10414ZoneInfo validation with various invalid types by @sydney-runkle in #10408Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.1...v2.9.2
Fix Predicate issue in v2.9.0 by @sydney-runkle in #10321
annotated-types bound to >=0.6.0 by @sydney-runkle in #10327tzdata install requirement into optional timezone dependency by @jakob-keller in #10331IncExc type alias definition by @Viicos in #10339Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.0...v2.9.1
Breaking Change: Merge dict type json_schema_extra by @sydney-runkle in #9792
The code released in v2.9.0 is practically identical to that of v2.9.0b2.
Check out our blog post to learn more about the release highlights!
ruff to v0.5.0 and pyright to v1.1.369 by @sydney-runkle in #9801pydantic-extra-types to v2.9.0 by @sydney-runkle in #9832pdm v2.18.1 by @Viicos in #10138v1 version stub to v1.10.18 by @sydney-runkle in #10214pydantic-core to v2.23.2 by @sydney-runkle in #10311ZoneInfo by @Youssefares in #9896Config.val_json_bytes by @josh-newman in #9770complex number by @changhc in #9654annotated_types.Not by @aditkumar72 in #10210WithJsonSchema to inject $refs w/ http or https links by @dAIsySHEng1 in #9863PathLike types by @nix010 in #9764str or callable discriminators to select the correct serializer by @sydney-runkle in in pydantic/pydantic-core#1397dict type json_schema_extra by @sydney-runkle in #9792
pattern for incompatible types by @sydney-runkle in #10158'allOf' JSON schema workarounds by @dpeachey in #10029typed_dict_cls data from CoreMetadata by @sydney-runkle in #10180Examples class by @Viicos in #10181initial_metadata from internal metadata construct by @sydney-runkle in #10194re.Pattern.search instead of re.Pattern.match for consistency with rust behavior by @tinez in pydantic/pydantic-core#1368pydantic-core serialization warning by @BoxyUwU in pydantic/pydantic-core#1377pydantic-core, change metadata type hint in core schemas from Any -> Dict[str, Any] | None by @sydney-runkle in pydantic/pydantic-core#1411self isn't returned from model validator by @sydney-runkle in #10255BaseModel by @sydney-runkle in #10013multiple_of_validator() by 31% in pydantic/_internal/_validators.py by @misrasaurabh1 in #9839ModelPrivateAttr.__set_name__() by 18% in pydantic/fields.py by @misrasaurabh1 in #9841dataclass() by 7% in pydantic/dataclasses.py by @misrasaurabh1 in #9843_field_name_for_signature by 37% in pydantic/_internal/_signature.py by @misrasaurabh1 in #9951GenerateSchema._unpack_refs_defs by 26% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9949apply_each_item_validators by 100% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9950ConfigWrapper.core_config by 28% in pydantic/_internal/_config.py by @misrasaurabh1 in #9953use_enum_values on Literal types by @kwint in #9787BaseModel/RootModel inheritance by @dmontagu in #9913str type annotation with Any in validator factories in documentation on validators by @maximilianfellhuber in #9885ComputedFieldInfo.wrapped_property pointer when a property setter is assigned by @tlambert03 in #9892main.IncEnx by @tlambert03 in #9924type[Annotated[...]] by @Viicos in #9932mypy plugin: handle frozen fields on a per-field basis by @dmontagu in #9935invalid-annotated-type error code by @sydney-runkle in #9948uuid, url, and ip types by @sydney-runkle in #9975date schemas to _generate_schema.py by @sydney-runkle in #9976decimal.Decimal validation to _generate_schema.py by @sydney-runkle in #9977_std_types_schema.py by @sydney-runkle in #9959GenerateSchema.match_type options by @sydney-runkle in #9961dataclass ignoring default_factory passed in Annotated by @kc0506 in #9971Sequence ignoring discriminator by @kc0506 in #9980IPvAnyAddress and IPvAnyInterface by @haoyun in #9990mypy plugin for from_orm check requiring from_attributes=True config by @radekwlsk in #9938strict=True to __init__ in mypy plugin by @kc0506 in #9998deque annotations by @sydney-runkle in #10018__pydantic_extra__ annotation in specific circumstances by @Viicos in #10070frozen enforcement for dataclasses by @sydney-runkle in #10066__get_pydantic_core_schema__ signature by @Viicos in #10075is_annotated consistently by @Viicos in #10095PydanticDeprecatedSince26 typo by @kc0506 in #10101pyright tests, refactor model decorators signatures by @Viicos in #10092ip serialization logic by @sydney-runkle in #10112dataclasses by @mochi22 in #10082when_used set to 'json-unless-none' and the default value is None by @Viicos in #10121ImportString special cases by @sydney-runkle in #10137__ prefixed annotations by @sydney-runkle in #10136nullable schemas with serialization schema available during JSON Schema generation by @Viicos in #10132BaseModel annotations by @kc0506 in #10110PrivateAttr with Annotated by @Viicos in #10157number type for literal and enum schemas by @Viicos in #10172Mapping and MutableMapping annotations to use mapping schema instead of dict schema by @sydney-runkle in #10020field_serializer with computed field when using * by @nix010 in pydantic/pydantic-core#1349Union serializer before inference by @sydney-runkle in pydantic/pydantic-core#1398float serialization behavior in strict mode by @sydney-runkle in pydantic/pydantic-core#1400exactness into Decimal validation logic to improve union validation behavior by @sydney-runkle in in pydantic/pydantic-core#1405pytest.warns() by @mgorny in #10241ModelMetaclass by @Viicos in #10242__init__ by @Viicos in #10264BigInt serialization for int subclasses by @kxx317 in pydantic/pydantic-core#1417info by @sydney-runkle in #10277__pydantic_complete__ is set when rebuilding dataclasses by @Viicos in #10291schema_generator config value in TypeAdapter by @sydney-runkle in #10300pydanticpydantic-coreBump pydantic-core to v2.23.1 and other minor version bumps by @sydney-runkle in #10269
pydantic-core to v2.23.1 and other minor version bumps by @sydney-runkle in #10269self isn't returned from model validator by @sydney-runkle in #10255pytest.warns() by @mgorny in #10241ModelMetaclass by @Viicos in #10242__init__ by @Viicos in #10264BigInt serialization for int subclasses by @kxx317 in pydantic/pydantic-core#1417Breaking Change: Merge dict type json_schema_extra by @sydney-runkle in #9792
ruff to v0.5.0 and pyright to v1.1.369 by @sydney-runkle in #9801pydantic-extra-types to v2.9.0 by @sydney-runkle in #9832pdm v2.18.1 by @Viicos in #10138pydantic-core to v2.23.0 by @sydney-runkle in #10180v1 version stub to v1.10.18 by @sydney-runkle in #10214ZoneInfo by @Youssefares in #9896Config.val_json_bytes by @josh-newman in #9770complex number by @changhc in #9654annotated_types.Not by @aditkumar72 in #10210WithJsonSchema to inject $refs w/ http or https links by @dAIsySHEng1 in #9863PathLike types by @nix010 in #9764str or callable discriminators to select the correct serializer by @sydney-runkle in in pydantic/pydantic-core#1397dict type json_schema_extra by @sydney-runkle in #9792
pattern for incompatible types by @sydney-runkle in #10158'allOf' JSON schema workarounds by @dpeachey in #10029typed_dict_cls data from CoreMetadata by @sydney-runkle in #10180Examples class by @Viicos in #10181initial_metadata from internal metadata construct by @sydney-runkle in #10194re.Pattern.search instead of re.Pattern.match for consistency with rust behavior by @tinez in pydantic/pydantic-core#1368pydantic-core serialization warning by @BoxyUwU in pydantic/pydantic-core#1377pydantic-core, change metadata type hint in core schemas from Any -> Dict[str, Any] | None by @sydney-runkle in pydantic/pydantic-core#1411BaseModel by @sydney-runkle in #10013multiple_of_validator() by 31% in pydantic/_internal/_validators.py by @misrasaurabh1 in #9839ModelPrivateAttr.__set_name__() by 18% in pydantic/fields.py by @misrasaurabh1 in #9841dataclass() by 7% in pydantic/dataclasses.py by @misrasaurabh1 in #9843_field_name_for_signature by 37% in pydantic/_internal/_signature.py by @misrasaurabh1 in #9951GenerateSchema._unpack_refs_defs by 26% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9949apply_each_item_validators by 100% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9950ConfigWrapper.core_config by 28% in pydantic/_internal/_config.py by @misrasaurabh1 in #9953use_enum_values on Literal types by @kwint in #9787BaseModel/RootModel inheritance by @dmontagu in #9913str type annotation with Any in validator factories in documentation on validators by @maximilianfellhuber in #9885ComputedFieldInfo.wrapped_property pointer when a property setter is assigned by @tlambert03 in #9892main.IncEnx by @tlambert03 in #9924type[Annotated[...]] by @Viicos in #9932mypy plugin: handle frozen fields on a per-field basis by @dmontagu in #9935invalid-annotated-type error code by @sydney-runkle in #9948uuid, url, and ip types by @sydney-runkle in #9975date schemas to _generate_schema.py by @sydney-runkle in #9976decimal.Decimal validation to _generate_schema.py by @sydney-runkle in #9977_std_types_schema.py by @sydney-runkle in #9959GenerateSchema.match_type options by @sydney-runkle in #9961dataclass ignoring default_factory passed in Annotated by @kc0506 in #9971Sequence ignoring discriminator by @kc0506 in #9980IPvAnyAddress and IPvAnyInterface by @haoyun in #9990mypy plugin for from_orm check requiring from_attributes=True config by @radekwlsk in #9938strict=True to __init__ in mypy plugin by @kc0506 in #9998deque annotations by @sydney-runkle in #10018__pydantic_extra__ annotation in specific circumstances by @Viicos in #10070frozen enforcement for dataclasses by @sydney-runkle in #10066__get_pydantic_core_schema__ signature by @Viicos in #10075is_annotated consistently by @Viicos in #10095PydanticDeprecatedSince26 typo by @kc0506 in #10101pyright tests, refactor model decorators signatures by @Viicos in #10092ip serialization logic by @sydney-runkle in #10112dataclasses by @mochi22 in #10082when_used set to 'json-unless-none' and the default value is None by @Viicos in #10121ImportString special cases by @sydney-runkle in #10137__ prefixed annotations by @sydney-runkle in #10136nullable schemas with serialization schema available during JSON Schema generation by @Viicos in #10132BaseModel annotations by @kc0506 in #10110PrivateAttr with Annotated by @Viicos in #10157number type for literal and enum schemas by @Viicos in #10172Mapping and MutableMapping annotations to use mapping schema instead of dict schema by @sydney-runkle in #10020field_serializer with computed field when using * by @nix010 in pydantic/pydantic-core#1349Union serializer before inference by @sydney-runkle in pydantic/pydantic-core#1398float serialization behavior in strict mode by @sydney-runkle in pydantic/pydantic-core#1400exactness into Decimal validation logic to improve union validation behavior by @sydney-runkle in in pydantic/pydantic-core#1405pydanticpydantic-coreFull Changelog: https://github.com/pydantic/pydantic/compare/v2.8.1...v2.8.2
Fix issue with assertion caused by pluggable schema validator by @dmontagu in #9838
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.8.1...v2.8.2
Fix breaking change in to_snake from v2.7 -> v2.8 by @sydney-runkle in #9812
ruff to v0.5.0 and pyright to v1.1.369 by @sydney-runkle in #9801pydantic-core to v2.20.1, pydantic-extra-types to v2.9.0 by @sydney-runkle in #9832to_snake from v2.7 -> v2.8 by @sydney-runkle in #9812Full Changelog: https://github.com/pydantic/pydantic/compare/v2.8.0...v2.8.1
Breaking Change: Improve smart union matching logic by @sydney-runkle in pydantic/pydantic-core#1322 You can read more about our smart union matching…
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!
v1.1.367 and add type checking tests for pipeline API by @adriangb in #9674pydantic.v1 stub to v1.10.17 by @sydney-runkle in #9707v2.8.0b1 by @sydney-runkle in #9741pydantic-core to v2.20.0 by @sydney-runkle in #9745pdm version used for pdm.lock to v2.16.1 by @sydney-runkle in #9761ruff v0.4.8 by @Viicos in #9585defer_build for TypeAdapter by @MarkusSintonen in #8939deprecated field in json schema by @NeevCohen in #9298fail_fast feature by @uriyyo in #9708ser_json_inf_nan='strings' mode to produce valid JSON by @josh-newman in pydantic/pydantic-core#1307Annotated field by @nix010 in #9170__validators__ values in create_model by @sydney-runkle in #9697smart 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._display_error_loc() by 25% in pydantic/v1/error_wrappers.py by @misrasaurabh1 in #9653_get_all_json_refs() by 34% in pydantic/json_schema.py by @misrasaurabh1 in #9650is_pydantic_dataclass() by 41% in pydantic/dataclasses.py by @misrasaurabh1 in #9652to_snake() by 27% in pydantic/alias_generators.py by @misrasaurabh1 in #9747unwrap_wrapped_function() by 93% in pydantic/_internal/_decorators.py by @misrasaurabh1 in #9727__spec__.parent with __package__ by @hramezani in #9331Sequence type by @anesmemisevic in #9303_frame_depth by @Viicos in #9353ImportString json schema compatible by @amitschang in #9344PrivateAttr) from __init__ signature in type checkers by @idan22moral in #9293TypeVar defaults robust to the CPython PEP-696 implementation by @AlexWaygood in #9426PlainSerializer with builtin types by @Viicos in #9450strict specification for StringConstraint(strict=False) by @vbmendes in #9476Self where possible by @Viicos in #9479RootModel.model_construct signature in the mypy plugin by @Viicos in #9480validation_context by @OhioDschungel6 in #9508dump_json/dump_python by @alexcouper in #9495Field() constructor by @bjmc in #9484TypeAdapter by @Viicos in #9570__setstate__ of BaseModel by @anhpham1509 in #9584PEP 746 by @adriangb in #9587TypeVar fields by @dmontagu in #9606regex flags in validation and json schema by @sydney-runkle in #9591IpvAnyAddress by @sydney-runkle in #9640__pydantic_extra__ by @dmontagu in #9659Optional[Decimal] by @lazyhope in #9754validate_call type params fix by @sydney-runkle in #9760pytest.warns() by @s-t-e-v-e-n-k in #9702re.Pattern object in regex patterns to allow for regex flags by @sydney-runkle in pydantic/pydantic-core#1318Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.4...v2.8.0/
Breaking Change: Improve smart union matching logic by @sydney-runkle in pydantic/pydantic-core#1322 You can read more about our smart union matching…
v1.1.367 and add type checking tests for pipeline API by @adriangb in #9674pydantic.v1 stub to v1.10.17 by @sydney-runkle in #9707v2.8.0b1 by @sydney-runkle in #9741pydantic-core to v2.20.0 by @sydney-runkle in #9745pdm version used for pdm.lock to v2.16.1 by @sydney-runkle in #9761ruff v0.4.8 by @Viicos in #9585defer_build for TypeAdapter by @MarkusSintonen in #8939deprecated field in json schema by @NeevCohen in #9298fail_fast feature by @uriyyo in #9708ser_json_inf_nan='strings' mode to produce valid JSON by @josh-newman in pydantic/pydantic-core#1307Annotated field by @nix010 in #9170__validators__ values in create_model by @sydney-runkle in #9697smart 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._display_error_loc() by 25% in pydantic/v1/error_wrappers.py by @misrasaurabh1 in #9653_get_all_json_refs() by 34% in pydantic/json_schema.py by @misrasaurabh1 in #9650is_pydantic_dataclass() by 41% in pydantic/dataclasses.py by @misrasaurabh1 in #9652to_snake() by 27% in pydantic/alias_generators.py by @misrasaurabh1 in #9747unwrap_wrapped_function() by 93% in pydantic/_internal/_decorators.py by @misrasaurabh1 in #9727__spec__.parent with __package__ by @hramezani in #9331Sequence type by @anesmemisevic in #9303_frame_depth by @Viicos in #9353ImportString json schema compatible by @amitschang in #9344PrivateAttr) from __init__ signature in type checkers by @idan22moral in #9293TypeVar defaults robust to the CPython PEP-696 implementation by @AlexWaygood in #9426PlainSerializer with builtin types by @Viicos in #9450strict specification for StringConstraint(strict=False) by @vbmendes in #9476Self where possible by @Viicos in #9479RootModel.model_construct signature in the mypy plugin by @Viicos in #9480validation_context by @OhioDschungel6 in #9508dump_json/dump_python by @alexcouper in #9495Field() constructor by @bjmc in #9484TypeAdapter by @Viicos in #9570__setstate__ of BaseModel by @anhpham1509 in #9584PEP 746 by @adriangb in #9587TypeVar fields by @dmontagu in #9606regex flags in validation and json schema by @sydney-runkle in #9591IpvAnyAddress by @sydney-runkle in #9640__pydantic_extra__ by @dmontagu in #9659Optional[Decimal] by @lazyhope in #9754validate_call type params fix by @sydney-runkle in #9760pytest.warns() by @s-t-e-v-e-n-k in #9702re.Pattern object in regex patterns to allow for regex flags by @sydney-runkle in pydantic/pydantic-core#1318Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.4...v2.8.0b1/
Bump pydantic.v1 to v1.10.16 reference by @sydney-runkle in #9639
Bump pydantic-core to v2.18.4 by @sydney-runkle in #9550
pydantic-core to v2.18.4 by @sydney-runkle in #9550Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.2...v2.7.3/*
Bump pydantic-core to v2.18.3 by @sydney-runkle in #9515
pydantic-core to v2.18.3 by @sydney-runkle in #9515__spec__.parent with __package__ by @hramezani in #9331ints with leading unary minus by @RajatRajdeep in pydantic/pydantic-core#1291str subclass validation for enums by @sydney-runkle in pydantic/pydantic-core#1273BigInts in Literals and Enums by @samuelcolvin in pydantic/pydantic-core#1297str subclass as input by @davidhewitt in pydantic/pydantic-core#1296Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.1...v2.7.2/
Bump pydantic-core to `v2.18.2` by @sydney-runkle in #9307
… by @LouisGobert in #9214validation_alias behavior with model_construct for AliasChoices and AliasPath by @sydney-runkle in #9223typing.Literal and import it outside the TYPE_CHECKING block by @frost-nzcr4 in #9232Secret serialization schema, applicable for unions by @sydney-runkle in #9240strict application to function-after with use_enum_values by @sydney-runkle in #9279model_construct on a class which defines model_post_init fails with AttributeError by @babygrimes in #9168model_json_schema with config types by @NeevCohen in #9287int by @samuelcolvin in pydantic/pydantic-core#1269ints with leading unary plus by @cknv in pydantic/pydantic-core#1272extra != 'ignore' and from_attributes=True by @davidhewitt in pydantic/pydantic-core#1276Enum's missing function as ValidationError by @sydney-runkle in pydantic/pydantic-core#1274Iterable validation by @davidhewitt in pydantic/pydantic-core#1271Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.0...v2.7.1/
Add support for deprecated fields by @Viicos in #8237
The code released in v2.7.0 is practically identical to that of v2.7.0b1.
pyproject.toml sections by @Viicos in #8899pydantic-core to v2.18.1 by @sydney-runkle in #9211jiter v0.2.0 by @samuelcolvin in pydantic/pydantic-core#1250FieldInfo.description by @Viicos in #6563with_config decorator to comply with typing spec by @Viicos in #8611ByteSize.human_readable by @jks15satoshi in #8706Secret base type by @conradogarciaberrotaran in #8519Sphinx inventories for cross references in docs by @Viicos in #8682deprecated fields by @Viicos in #8237field_serializer('*') by @ornariece in #9001model_config is defined as a model property by @alexeyt101 in #9004create_model() to support typing.Annotated as input by @wannieman98 in #8947ClickhouseDsn support by @solidguy7 in #9062re.Pattern[str] to pattern field by @jag-k in #9053serialize_as_any runtime setting by @sydney-runkle in #8830typing.Self by @Youssefares in #9023context to serialization by @ornariece in #8965Finalized in v2.7.0, rather than v2.7.0b1:
warnings parameter for serialization utilities to allow raising a warning by @Lance-Drane in #9166model_construct behavior with extra by @sydney-runkle in #8807RootModel subclasses by @sydney-runkle in #8857PEP570 syntax by @Viicos in #8940enum and type to the JSON schema for single item literals by @dmontagu in #8944update_json_schema internal function by @sydney-runkle in #9125enum validator improvements by @samuelcolvin in #9045enum validation and serialization to Rust by @samuelcolvin in #9064aarch64(Note: SIMD on x86 will be implemented in a future release) by @samuelcolvin in in pydantic/jiter#65Cow<str> from jiter by @davidhewitt in pydantic/pydantic-core#1231Sequences by @sydney-runkle in #8614__qualname__ by @anci3ntr0ck in #8642__pydantic_extra__ annotation being a string or inherited by @alexmojaki in #8659NameEmail by @Holi0317 in #8650BaseModel by @bluenote10 in #8651mypy plugin and no_strict_optional = True by @dmontagu in #8666ByteSize error type change by @sydney-runkle in #8681__pydantic_config__ ignored for TypeDict by @13sin in #8734pytest v8.0.0 due to pytest.warns() starting to work inside pytest.raises() by @mgorny in #8678is_valid_field from 1.x for mypy plugin by @DanielNoord in #8738mypy strict equality flag by @dmontagu in #8799FieldInfo.__repr_args__ by @sydney-runkle in #8801BaseModel type annotations to be resolvable by typing.get_type_hints by @devmonkey22 in #7680AliasGenerator by @sydney-runkle in #8810date -> datetime timezone assumption fix by @sydney-runkle in #8823ast.Str by @Viicos in #8837deprecated decorators by @Viicos in #8877NameEmail if name includes an email address by @NeevCohen in #8860TypeAdapter's typing compatible with special forms by @adriangb in #8923enums by @dmontagu in #8920model_json_schema usage by @sydney-runkle in #8928mypy plugin by @dmontagu in #9008PlainSerializer usage with std type constructor by @sydney-runkle in #9031Model.__getattr__() by @NeevCohen in #9082ClassVar forward ref inherited from parent class by @alexmojaki in #9097True by @andresliszt in #8977deque when passed to Sequence[blah blah blah] by @sydney-runkle in #9128model_post_init by @Viicos in #9134model_construct with validation_alias by @ornariece in #9144Literal null types by @bruno-f-cruz in #9135Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.4...v2.7.0/
Add support for deprecated fields by @Viicos in #8237
pyproject.toml sections by @Viicos in #8899pydantic-core to v2.18.0 by @sydney-runkle in #9153jiter v0.2.0 by @samuelcolvin in pydantic/pydantic-core#1250FieldInfo.description by @Viicos in #6563with_config decorator to comply with typing spec by @Viicos in #8611ByteSize.human_readable by @jks15satoshi in #8706Secret base type by @conradogarciaberrotaran in #8519Sphinx inventories for cross references in docs by @Viicos in #8682deprecated fields by @Viicos in #8237field_serializer('*') by @ornariece in #9001model_config is defined as a model property by @alexeyt101 in #9004create_model() to support typing.Annotated as input by @wannieman98 in #8947ClickhouseDsn support by @solidguy7 in #9062re.Pattern[str] to pattern field by @jag-k in #9053serialize_as_any runtime setting by @sydney-runkle in #8830typing.Self by @Youssefares in #9023context to serialization by @ornariece in #8965model_construct behavior with extra by @sydney-runkle in #8807RootModel subclasses by @sydney-runkle in #8857PEP570 syntax by @Viicos in #8940enum and type to the JSON schema for single item literals by @dmontagu in #8944update_json_schema internal function by @sydney-runkle in #9125enum validator improvements by @samuelcolvin in #9045enum validation and serialization to Rust by @samuelcolvin in #9064aarch64(Note: SIMD on x86 will be implemented in a future release) by @samuelcolvin in in pydantic/jiter#65Cow<str> from jiter by @davidhewitt in pydantic/pydantic-core#1231Sequences by @sydney-runkle in #8614__qualname__ by @anci3ntr0ck in #8642__pydantic_extra__ annotation being a string or inherited by @alexmojaki in #8659NameEmail by @Holi0317 in #8650BaseModel by @bluenote10 in #8651mypy plugin and no_strict_optional = True by @dmontagu in #8666ByteSize error type change by @sydney-runkle in #8681__pydantic_config__ ignored for TypeDict by @13sin in #8734pytest v8.0.0 due to pytest.warns() starting to work inside pytest.raises() by @mgorny in #8678is_valid_field from 1.x for mypy plugin by @DanielNoord in #8738mypy strict equality flag by @dmontagu in #8799FieldInfo.__repr_args__ by @sydney-runkle in #8801BaseModel type annotations to be resolvable by typing.get_type_hints by @devmonkey22 in #7680AliasGenerator by @sydney-runkle in #8810date -> datetime timezone assumption fix by @sydney-runkle in #8823ast.Str by @Viicos in #8837deprecated decorators by @Viicos in #8877NameEmail if name includes an email address by @NeevCohen in #8860TypeAdapter's typing compatible with special forms by @adriangb in #8923enums by @dmontagu in #8920model_json_schema usage by @sydney-runkle in #8928mypy plugin by @dmontagu in #9008PlainSerializer usage with std type constructor by @sydney-runkle in #9031Model.__getattr__() by @NeevCohen in #9082ClassVar forward ref inherited from parent class by @alexmojaki in #9097True by @andresliszt in #8977deque when passed to Sequence[blah blah blah] by @sydney-runkle in #9128model_post_init by @Viicos in #9134model_construct with validation_alias by @ornariece in #9144Literal null types by @bruno-f-cruz in #9135Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.4...v2.7.0b1/
Fix usage of AliasGenerator with computed_field decorator by @sydney-runkle in #8806
AliasGenerator with computed_field decorator by @sydney-runkle in #8806Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.3...v2.6.4/
Your coding agent can read these notes before it upgrades. Set up the MCP server →