pydantic 1.10.26
Data validation and settings management using python type hints
License: MIT
Requires Python: >=3.7

# pydantic

[![CI](https://github.com/pydantic/pydantic/workflows/CI/badge.svg?event=push)](https://github.com/pydantic/pydantic/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
[![Coverage](https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic.svg?branch=1.10.X-fixes)](https://coverage-badge.samuelcolvin.workers.dev/redirect/pydantic/pydantic?branch=1.10.X-fixes)
[![pypi](https://img.shields.io/pypi/v/pydantic.svg)](https://pypi.python.org/pypi/pydantic)
[![CondaForge](https://img.shields.io/conda/v/conda-forge/pydantic.svg)](https://anaconda.org/conda-forge/pydantic)
[![downloads](https://pepy.tech/badge/pydantic/month)](https://pepy.tech/project/pydantic)
[![versions](https://img.shields.io/pypi/pyversions/pydantic.svg)](https://github.com/pydantic/pydantic)
[![license](https://img.shields.io/github/license/pydantic/pydantic.svg)](https://github.com/pydantic/pydantic/blob/main/LICENSE)

Data validation and settings management using Python type hints.

Fast and extensible, *pydantic* plays nicely with your linters/IDE/brain.
Define how data should be in pure, canonical Python 3.7+; validate it with *pydantic*.

## Pydantic Company :rocket:

We've started a company based on the principles that I believe have led to Pydantic's success.
Learning more from the [Company Announcement](https://pydantic.dev/announcement/).

## Help

See [documentation](https://docs.pydantic.dev/) for more details.

## Installation

Install using `pip install -U pydantic` or `conda install pydantic -c conda-forge`.
For more installation options to make *pydantic* even faster,
see the [Install](https://docs.pydantic.dev/install/) section in the documentation.

## A Simple Example

```py
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel

class User(BaseModel):
    id: int
    name = 'John Doe'
    signup_ts: Optional[datetime] = None
    friends: List[int] = []

external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
user = User(**external_data)
print(user)
#> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
print(user.id)
#> 123
```

## Contributing

For guidance on setting up a development environment and how to make a
contribution to *pydantic*, see
[Contributing to Pydantic](https://docs.pydantic.dev/contributing/).

## Reporting a Security Vulnerability

See our [security policy](https://github.com/pydantic/pydantic/security/policy).


## v1.10.26 (2025-12-18)

* Fix syntax error under Python 3.7 by [@Viicos](https://github.com/Viicos) in https://github.com/pydantic/pydantic/pull/12643

## v1.10.25 (2025-12-18)

* Add minimal support for Python 3.14 by [@Viicos](https://github.com/Viicos) in https://github.com/pydantic/pydantic/pull/12636

## v1.10.24 (2025-09-25)

* Add user warning when using Python 3.14 by [@Viicos](https://github.com/Viicos) in https://github.com/pydantic/pydantic/pull/12263
  Pydantic V1 will *not* work with Python 3.14 and greater. A warning is now raised as no actual
  error show up when using it, but the core behavior will silently get broken at runtime.
* Fix mypy plugin issue for mypy v1.18 by [@cdce8p](https://github.com/cdce8p) in https://github.com/pydantic/pydantic/pull/12254
  This fixes another mypy issue that was discovered after the previous v1.10.23 release.

## v1.10.23 (2025-09-13)

* Fix mypy plugin for mypy 1.18 by [@cdce8p](https://github.com/cdce8p) in https://github.com/pydantic/pydantic/pull/12207

## v1.10.22 (2025-04-17)

* Fix compatibility with `typing-extensions` by [@Viicos](https://github.com/Viicos) in https://github.com/pydantic/pydantic/pull/11764

## v1.10.21 (2025-01-10)

* Fix compatibility with ForwardRef._evaluate and Python < 3.12.4 by [@griels](https://github.com/griels) in https://github.com/pydantic/pydantic/pull/11232

## v1.10.20 (2025-01-07)

This release provides proper support for Python 3.13, with (Cythonized) wheels published for this version.
As a consequence, Cython was updated from `0.29.x` to `3.0.x`.

* General maintenance of CI and build ecosystem by [@Viicos](https://github.com/Viicos) in https://github.com/pydantic/pydantic/pull/10847
  - Update Cython to `3.0.x`.
  - Properly address Python 3.13 deprecation warnings.
  - Migrate packaging to `pyproject.toml`, make use of PEP 517 build options.
  - Use [`build`](https://pypi.org/project/build/) instead of direct `setup.py` invocations.
  - Update various Github Actions versions.
* Replace outdated stpmex link in documentation by [@jaredenorris](https://github.com/jaredenorris) in https://github.com/pydantic/pydantic/pull/10997

## v1.10.19 (2024-11-06)

* Add warning when v2 model is nested in v1 model by [@sydney-runkle](https://github.com/sydney-runkle) in https://github.com/pydantic/pydantic/pull/10432
* Fix deprecation warning in V1 `isinstance` check by [@alicederyn](https://github.com/alicederyn) in https://github.com/pydantic/pydantic/pull/10645

## v1.10.18 (2024-08-22)

* Eval type fix in V1 by [@sydney-runkle](https://github.com/sydney-runkle) in https://github.com/pydantic/pydantic/pull/9751
* Add `to_lower_camel` to `__all__` in `utils.py` by [@sydney-runkle](https://github.com/sydney-runkle) (direct commit)
* Fix `mypy` v1 plugin for mypy 1.11 release by [@flaeppe](https://github.com/flaeppe) in https://github.com/pydantic/pydantic/pull/10139
* Fix discriminator key used when discriminator has alias and `.schema(by_alias=False)` by [@exs-dwoodward](https://github.com/exs-dwoodward) in https://github.com/pydantic/pydantic/pull/10146

## v1.10.17 (2024-06-20)

* Advertise Python 3.12 for 1.10.x! Part Deux by [@vfazio](https://github.com/vfazio) in https://github.com/pydantic/pydantic/pull/9644
* Mirrored modules in `v1` namespace to fix typing and object resolution in python>3.11 by [@exs-dwoodward](https://github.com/exs-dwoodward) in https://github.com/pydantic/pydantic/pull/9660
* Setup: remove upper bound from python_requires by [@vfazio](https://github.com/vfazio) in https://github.com/pydantic/pydantic/pull/9685

## v1.10.16 (2024-06-11)

* Specify recursive_guard as kwarg in FutureRef._evaluate by [@vfazio](https://github.com/vfazio) in https://github.com/pydantic/pydantic/pull/9612
* Fix mypy v1 plugin for upcoming mypy release by @ cdce8p in https://github.com/pydantic/pydantic/pull/9586
* Import modules/objects directly from v1 namespace by [@exs-dwoodward](https://github.com/exs-dwoodward) in https://github.com/pydantic/pydantic/pull/9162

## v1.10.15 (2024-04-03)

* Add pydantic.v1 namespace to Pydantic v1 by [@exs-dmiketa](https://github.com/exs-dmiketa) in https://github.com/pydantic/pydantic/pull/9042
* Relax version of typing-extensions for V1 by [@SonOfLilit](https://github.com/SonOfLilit) in https://github.com/pydantic/pydantic/pull/8819
* patch fix for mypy by [@sydney-runkle](https://github.com/sydney-runkle) in https://github.com/pydantic/pydantic/pull/8765

## v1.10.14 (2024-01-19)

* Update install.md by [@dmontagu](https://github.com/dmontagu) in https://github.com/pydantic/pydantic/pull/7690
* Fixes ci to only deploy docs on release by [@sydney-runkle](https://github.com/sydney-runkle) in https://github.com/pydantic/pydantic/pull/7740
* Ubuntu fixes for V1 by [@sydney-runkle](https://github.com/sydney-runkle) in https://github.com/pydantic/pydantic/pull/8540 and https://github.com/pydantic/pydantic/pull/8587
* Fix cached_property handling in dataclasses when copied by [@rdbisme](https://github.com/rdbisme) in https://github.com/pydantic/pydantic/pull/8407

## v1.10.13 (2023-09-27)

* Fix: Add max length check to `pydantic.validate_email`, [#7673](https://github.com/pydantic/pydantic/issues/7673) by [@hramezani](https://github.com/hramezani)
* Docs: Fix pip commands to install v1, [#6930](https://github.com/pydantic/pydantic/issues/6930) by [@chbndrhnns](https://github.com/chbndrhnns)

## v1.10.12 (2023-07-24)

* Fixes the `maxlen` property being dropped on `deque` validation. Happened only if the deque item has been typed. Changes the `_validate_sequence_like` func, [#6581](https://github.com/pydantic/pydantic/issues/6581) by [@maciekglowka](https://github.com/maciekglowka)

## v1.10.11 (2023-07-04)

* Importing create_model in tools.py through relative path instead of absolute path - so that it doesn't import V2 code when copied over to V2 branch, [#6361](https://github.com/pydantic/pydantic/issues/6361) by [@SharathHuddar](https://github.com/SharathHuddar)

## v2.0b3 (2023-06-16)

Third beta pre-release of Pydantic V2

See the full changelog [here](https://github.com/pydantic/pydantic/releases/tag/v2.0b3)

## v2.0b2 (2023-06-03)

Add `from_attributes` runtime flag to `TypeAdapter.validate_python` and `BaseModel.model_validate`.

See the full changelog [here](https://github.com/pydantic/pydantic/releases/tag/v2.0b2)

## v2.0b1 (2023-06-01)

First beta pre-release of Pydantic V2

See the full changelog [here](https://github.com/pydantic/pydantic/releases/tag/v2.0b1)

## v2.0a4 (2023-05-05)

Fourth pre-release of Pydantic V2

See the full changelog [here](https://github.com/pydantic/pydantic/releases/tag/v2.0a4)

## v2.0a3 (2023-04-20)

Third pre-release of Pydantic V2

See the full changelog [here](https://github.com/pydantic/pydantic/releases/tag/v2.0a3)

## v2.0a2 (2023-04-12)

Second pre-release of Pydantic V2

See the full changelog [here](https://github.com/pydantic/pydantic/releases/tag/v2.0a2)

## v2.0a1 (2023-04-03)

First pre-release of Pydantic V2!

See [this post](https://docs.pydantic.dev/blog/pydantic-v2-alpha/) for more details.

## v1.10.10 (2023-06-30)

* Add Pydantic `Json` field support to settings management, [#6250](https://github.com/pydantic/pydantic/issues/6250) by [@hramezani](https://github.com/hramezani)
* Fixed literal validator errors for unhashable values, [#6188](https://github.com/pydantic/pydantic/issues/6188) by [@markus1978](https://github.com/markus1978)
* Fixed bug with generics receiving forward refs, [#6130](https://github.com/pydantic/pydantic/issues/6130) by [@mark-todd](https://github.com/mark-todd)
* Update install method of FastAPI for internal tests in CI, [#6117](https://github.com/pydantic/pydantic/issues/6117) by [@Kludex](https://github.com/Kludex)

## v1.10.9 (2023-06-07)

* Fix trailing zeros not ignored in Decimal validation, [#5968](https://github.com/pydantic/pydantic/issues/5968) by [@hramezani](https://github.com/hramezani)
* Fix mypy plugin for v1.4.0, [#5928](https://github.com/pydantic/pydantic/issues/5928) by [@cdce8p](https://github.com/cdce8p)
* Add future and past date hypothesis strategies, [#5850](https://github.com/pydantic/pydantic/issues/5850) by [@bschoenmaeckers](https://github.com/bschoenmaeckers)
* Discourage usage of Cython 3 with Pydantic 1.x, [#5845](https://github.com/pydantic/pydantic/issues/5845) by [@lig](https://github.com/lig)

## v1.10.8 (2023-05-23)

* Fix a bug in `Literal` usage with `typing-extension==4.6.0`, [#5826](https://github.com/pydantic/pydantic/issues/5826) by [@hramezani](https://github.com/hramezani)
* This solves the (closed) issue [#3849](https://github.com/pydantic/pydantic/issues/3849) where aliased fields that use discriminated union fail to validate when the data contains the non-aliased field name, [#5736](https://github.com/pydantic/pydantic/issues/5736) by [@benwah](https://github.com/benwah)
* Update email-validator dependency to >=2.0.0post2, [#5627](https://github.com/pydantic/pydantic/issues/5627) by [@adriangb](https://github.com/adriangb)
* update `AnyClassMethod` for changes in [python/typeshed#9771](https://github.com/python/typeshed/issues/9771), [#5505](https://github.com/pydantic/pydantic/issues/5505) by [@ITProKyle](https://github.com/ITProKyle)

## v1.10.7 (2023-03-22)

* Fix creating schema from model using `ConstrainedStr` with `regex` as dict key, [#5223](https://github.com/pydantic/pydantic/issues/5223) by [@matejetz](https://github.com/matejetz)
* Address bug in mypy plugin caused by explicit_package_bases=True, [#5191](https://github.com/pydantic/pydantic/issues/5191) by [@dmontagu](https://github.com/dmontagu)
* Add implicit defaults in the mypy plugin for Field with no default argument, [#5190](https://github.com/pydantic/pydantic/issues/5190) by [@dmontagu](https://github.com/dmontagu)
* Fix schema generated for Enum values used as Literals in discriminated unions, [#5188](https://github.com/pydantic/pydantic/issues/5188) by [@javibookline](https://github.com/javibookline)
* Fix mypy failures caused by the pydantic mypy plugin when users define `from_orm` in their own classes, [#5187](https://github.com/pydantic/pydantic/issues/5187) by [@dmontagu](https://github.com/dmontagu)
* Fix `InitVar` usage with pydantic dataclasses, mypy version `1.1.1` and the custom mypy plugin, [#5162](https://github.com/pydantic/pydantic/issues/5162) by [@cdce8p](https://github.com/cdce8p)

## v1.10.6 (2023-03-08)

* Implement logic to support creating validators from non standard callables by using defaults to identify them and unwrapping `functools.partial` and `functools.partialmethod` when checking the signature, [#5126](https://github.com/pydantic/pydantic/issues/5126) by [@JensHeinrich](https://github.com/JensHeinrich)
* Fix mypy plugin for v1.1.1, and fix `dataclass_transform` decorator for pydantic dataclasses, [#5111](https://github.com/pydantic/pydantic/issues/5111) by [@cdce8p](https://github.com/cdce8p)
* Raise `ValidationError`, not `ConfigError`, when a discriminator value is unhashable, [#4773](https://github.com/pydantic/pydantic/issues/4773) by [@kurtmckee](https://github.com/kurtmckee)

## v1.10.5 (2023-02-15)

* Fix broken parametrized bases handling with `GenericModel`s with complex sets of models, [#5052](https://github.com/pydantic/pydantic/issues/5052) by [@MarkusSintonen](https://github.com/MarkusSintonen)
* Invalidate mypy cache if plugin config changes, [#5007](https://github.com/pydantic/pydantic/issues/5007) by [@cdce8p](https://github.com/cdce8p)
* Fix `RecursionError` when deep-copying dataclass types wrapped by pydantic, [#4949](https://github.com/pydantic/pydantic/issues/4949) by [@mbillingr](https://github.com/mbillingr)
* Fix `X | Y` union syntax breaking `GenericModel`, [#4146](https://github.com/pydantic/pydantic/issues/4146) by [@thenx](https://github.com/thenx)
* Switch coverage badge to show coverage for this branch/release, [#5060](https://github.com/pydantic/pydantic/issues/5060) by [@samuelcolvin](https://github.com/samuelcolvin)

## v1.10.4 (2022-12-30)

* Change dependency to `typing-extensions>=4.2.0`, [#4885](https://github.com/pydantic/pydantic/issues/4885) by [@samuelcolvin](https://github.com/samuelcolvin)

## v1.10.3 (2022-12-29)

**NOTE: v1.10.3 was ["yanked"](https://pypi.org/help/#yanked) from PyPI due to [#4885](https://github.com/pydantic/pydantic/issues/4885) which is fixed in v1.10.4**

* fix parsing of custom root models, [#4883](https://github.com/pydantic/pydantic/issues/4883) by [@gou177](https://github.com/gou177)
* fix: use dataclass proxy for frozen or empty dataclasses, [#4878](https://github.com/pydantic/pydantic/issues/4878) by [@PrettyWood](https://github.com/PrettyWood)
* Fix `schema` and `schema_json` on models where a model instance is a one of default values, [#4781](https://github.com/pydantic/pydantic/issues/4781) by [@Bobronium](https://github.com/Bobronium)
* Add Jina AI to sponsors on docs index page, [#4767](https://github.com/pydantic/pydantic/issues/4767) by [@samuelcolvin](https://github.com/samuelcolvin)
* fix: support assignment on `DataclassProxy`, [#4695](https://github.com/pydantic/pydantic/issues/4695) by [@PrettyWood](https://github.com/PrettyWood)
* Add `postgresql+psycopg` as allowed scheme for `PostgreDsn` to make it usable with SQLAlchemy 2, [#4689](https://github.com/pydantic/pydantic/issues/4689) by [@morian](https://github.com/morian)
* Allow dict schemas to have both `patternProperties` and `additionalProperties`, [#4641](https://github.com/pydantic/pydantic/issues/4641) by [@jparise](https://github.com/jparise)
* Fixes error passing None for optional lists with `unique_items`, [#4568](https://github.com/pydantic/pydantic/issues/4568) by [@mfulgo](https://github.com/mfulgo)
* Fix `GenericModel` with `Callable` param raising a `TypeError`, [#4551](https://github.com/pydantic/pydantic/issues/4551) by [@mfulgo](https://github.com/mfulgo)
* Fix field regex with `StrictStr` type annotation, [#4538](https://github.com/pydantic/pydantic/issues/4538) by [@sisp](https://github.com/sisp)
* Correct `dataclass_transform` keyword argument name from `field_descriptors` to `field_specifiers`, [#4500](https://github.com/pydantic/pydantic/issues/4500) by [@samuelcolvin](https://github.com/samuelcolvin)
* fix: avoid multiple calls of `__post_init__` when dataclasses are inherited, [#4487](https://github.com/pydantic/pydantic/issues/4487) by [@PrettyWood](https://github.com/PrettyWood)
* Reduce the size of binary wheels, [#2276](https://github.com/pydantic/pydantic/issues/2276) by [@samuelcolvin](https://github.com/samuelcolvin)

## v1.10.2 (2022-09-05)

* **Revert Change:** Revert percent encoding of URL parts which was originally added in [#4224](https://github.com/pydantic/pydantic/issues/4224), [#4470](https://github.com/pydantic/pydantic/issues/4470) by [@samuelcolvin](https://github.com/samuelcolvin)
* Prevent long (length > `4_300`) strings/bytes as input to int fields, see 
  [python/cpython#95778](https://github.com/python/cpython/issues/95778) and 
  [CVE-2020-10735](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735), [#1477](https://github.com/pydantic/pydantic/issues/1477) by [@samuelcolvin](https://github.com/samuelcolvin)
* fix: dataclass wrapper was not always called, [#4477](https://github.com/pydantic/pydantic/issues/4477) by [@PrettyWood](https://github.com/PrettyWood)
* Use `tomllib` on Python 3.11 when parsing `mypy` configuration, [#4476](https://github.com/pydantic/pydantic/issues/4476) by [@hauntsaninja](https://github.com/hauntsaninja)
* Basic fix of `GenericModel` cache to detect order of arguments in `Union` models, [#4474](https://github.com/pydantic/pydantic/issues/4474) by [@sveinugu](https://github.com/sveinugu)
* Fix mypy plugin when using bare types like `list` and `dict` as `default_factory`, [#4457](https://github.com/pydantic/pydantic/issues/4457) by [@samuelcolvin](https://github.com/samuelcolvin)

## v1.10.1 (2022-08-31)

* Add `__hash__` method to `pydancic.color.Color` class, [#4454](https://github.com/pydantic/pydantic/issues/4454) by [@czaki](https://github.com/czaki)

## v1.10.0 (2022-08-30)

* Refactor the whole _pydantic_ `dataclass` decorator to really act like its standard lib equivalent.
  It hence keeps `__eq__`, `__hash__`, ... and makes comparison with its non-validated version possible.
  It also fixes usage of `frozen` dataclasses in fields and usage of `default_factory` in nested dataclasses.
  The support of `Config.extra` has been added.
  Finally, config customization directly via a `dict` is now possible, [#2557](https://github.com/pydantic/pydantic/issues/2557) by [@PrettyWood](https://github.com/PrettyWood)
  <br/><br/>
  **BREAKING CHANGES:**
  - The `compiled` boolean (whether _pydantic_ is compiled with cython) has been moved from `main.py` to `version.py`
  - Now that `Config.extra` is supported, `dataclass` ignores by default extra arguments (like `BaseModel`)
* Fix PEP487 `__set_name__` protocol in `BaseModel` for PrivateAttrs, [#4407](https://github.com/pydantic/pydantic/issues/4407) by [@tlambert03](https://github.com/tlambert03)
* Allow for custom parsing of environment variables via `parse_env_var` in `Config`, [#4406](https://github.com/pydantic/pydantic/issues/4406) by [@acmiyaguchi](https://github.com/acmiyaguchi)
* Rename `master` to `main`, [#4405](https://github.com/pydantic/pydantic/issues/4405) by [@hramezani](https://github.com/hramezani)
* Fix `StrictStr` does not raise `ValidationError` when `max_length` is present in `Field`, [#4388](https://github.com/pydantic/pydantic/issues/4388) by [@hramezani](https://github.com/hramezani)
* Make `SecretStr` and `SecretBytes` hashable, [#4387](https://github.com/pydantic/pydantic/issues/4387) by [@chbndrhnns](https://github.com/chbndrhnns)
* Fix `StrictBytes` does not raise `ValidationError` when `max_length` is present in `Field`, [#4380](https://github.com/pydantic/pydantic/issues/4380) by [@JeanArhancet](https://github.com/JeanArhancet)
* Add support for bare `type`, [#4375](https://github.com/pydantic/pydantic/issues/4375) by [@hramezani](https://github.com/hramezani)
* Support Python 3.11, including binaries for 3.11 in PyPI, [#4374](https://github.com/pydantic/pydantic/issues/4374) by [@samuelcolvin](https://github.com/samuelcolvin)
* Add support for `re.Pattern`, [#4366](https://github.com/pydantic/pydantic/issues/4366) by [@hramezani](https://github.com/hramezani)
* Fix `__post_init_post_parse__` is incorrectly passed keyword arguments when no `__post_init__` is defined, [#4361](https://github.com/pydantic/pydantic/issues/4361) by [@hramezani](https://github.com/hramezani)
* Fix implicitly importing `ForwardRef` and `Callable` from `pydantic.typing` instead of `typing` and also expose `MappingIntStrAny`, [#4358](https://github.com/pydantic/pydantic/issues/4358) by [@aminalaee](https://github.com/aminalaee)
* remove `Any` types from the `dataclass` decorator so it can be used with the `disallow_any_expr` mypy option, [#4356](https://github.com/pydantic/pydantic/issues/4356) by [@DetachHead](https://github.com/DetachHead)
* moved repo to `pydantic/pydantic`, [#4348](https://github.com/pydantic/pydantic/issues/4348) by [@yezz123](https://github.com/yezz123)
* fix "extra fields not permitted" error when dataclass with `Extra.forbid` is validated multiple times, [#4343](https://github.com/pydantic/pydantic/issues/4343) by [@detachhead](https://github.com/detachhead)
* Add Python 3.9 and 3.10 examples to docs, [#4339](https://github.com/pydantic/pydantic/issues/4339) by [@Bobronium](https://github.com/Bobronium)
* Discriminated union models now use `oneOf` instead of `anyOf` when generating OpenAPI schema definitions, [#4335](https://github.com/pydantic/pydantic/issues/4335) by [@MaxwellPayne](https://github.com/MaxwellPayne)
* Allow type checkers to infer inner type of `Json` type. `Json[list[str]]` will be now inferred as `list[str]`, 
  `Json[Any]` should be used instead of plain `Json`.
  Runtime behaviour is not changed, [#4332](https://github.com/pydantic/pydantic/issues/4332) by [@Bobronium](https://github.com/Bobronium)
* Allow empty string aliases by using a `alias is not None` check, rather than `bool(alias)`, [#4253](https://github.com/pydantic/pydantic/issues/4253) by [@sergeytsaplin](https://github.com/sergeytsaplin)
* Update `ForwardRef`s in `Field.outer_type_`, [#4249](https://github.com/pydantic/pydantic/issues/4249) by [@JacobHayes](https://github.com/JacobHayes)
* The use of `__dataclass_transform__` has been replaced by `typing_extensions.dataclass_transform`, which is the preferred way to mark pydantic models as a dataclass under [PEP 681](https://peps.python.org/pep-0681/), [#4241](https://github.com/pydantic/pydantic/issues/4241) by [@multimeric](https://github.com/multimeric)
* Use parent model's `Config` when validating nested `NamedTuple` fields, [#4219](https://github.com/pydantic/pydantic/issues/4219) by [@synek](https://github.com/synek)
* Update `BaseModel.construct` to work with aliased Fields, [#4192](https://github.com/pydantic/pydantic/issues/4192) by [@kylebamos](https://github.com/kylebamos)
* Catch certain raised errors in `smart_deepcopy` and revert to `deepcopy` if so, [#4184](https://github.com/pydantic/pydantic/issues/4184) by [@coneybeare](https://github.com/coneybeare)
* Add `Config.anystr_upper` and `to_upper` kwarg to constr and conbytes, [#4165](https://github.com/pydantic/pydantic/issues/4165) by [@satheler](https://github.com/satheler)
* Fix JSON schema for `set` and `frozenset` when they include default values, [#4155](https://github.com/pydantic/pydantic/issues/4155) by [@aminalaee](https://github.com/aminalaee)
* Teach the mypy plugin that methods decorated by `@validator` are classmethods, [#4102](https://github.com/pydantic/pydantic/issues/4102) by [@DMRobertson](https://github.com/DMRobertson)
* Improve mypy plugin's ability to detect required fields, [#4086](https://github.com/pydantic/pydantic/issues/4086) by [@richardxia](https://github.com/richardxia)
* Support fields of type `Type[]` in schema, [#4051](https://github.com/pydantic/pydantic/issues/4051) by [@aminalaee](https://github.com/aminalaee)
* Add `default` value in JSON Schema when `const=True`, [#4031](https://github.com/pydantic/pydantic/issues/4031) by [@aminalaee](https://github.com/aminalaee)
* Adds reserved word check to signature generation logic, [#4011](https://github.com/pydantic/pydantic/issues/4011) by [@strue36](https://github.com/strue36)
* Fix Json strategy failure for the complex nested field, [#4005](https://github.com/pydantic/pydantic/issues/4005) by [@sergiosim](https://github.com/sergiosim)
* Add JSON-compatible float constraint `allow_inf_nan`, [#3994](https://github.com/pydantic/pydantic/issues/3994) by [@tiangolo](https://github.com/tiangolo)
* Remove undefined behaviour when `env_prefix` had characters in common with `env_nested_delimiter`, [#3975](https://github.com/pydantic/pydantic/issues/3975) by [@arsenron](https://github.com/arsenron)
* Support generics model with `create_model`, [#3945](https://github.com/pydantic/pydantic/issues/3945) by [@hot123s](https://github.com/hot123s)
* allow submodels to overwrite extra field info, [#3934](https://github.com/pydantic/pydantic/issues/3934) by [@PrettyWood](https://github.com/PrettyWood)
* Document and test structural pattern matching ([PEP 636](https://peps.python.org/pep-0636/)) on `BaseModel`, [#3920](https://github.com/pydantic/pydantic/issues/3920) by [@irgolic](https://github.com/irgolic)
* Fix incorrect deserialization of python timedelta object to ISO 8601 for negative time deltas.
  Minus was serialized in incorrect place ("P-1DT23H59M59.888735S" instead of correct "-P1DT23H59M59.888735S"), [#3899](https://github.com/pydantic/pydantic/issues/3899) by [@07pepa](https://github.com/07pepa)
* Fix validation of discriminated union fields with an alias when passing a model instance, [#3846](https://github.com/pydantic/pydantic/issues/3846) by [@chornsby](https://github.com/chornsby)
* Add a CockroachDsn type to validate CockroachDB connection strings. The type
  supports the following schemes: `cockroachdb`, `cockroachdb+psycopg2` and `cockroachdb+asyncpg`, [#3839](https://github.com/pydantic/pydantic/issues/3839) by [@blubber](https://github.com/blubber)
* Fix MyPy plugin to not override pre-existing `__init__` method in models, [#3824](https://github.com/pydantic/pydantic/issues/3824) by [@patrick91](https://github.com/patrick91)
* Fix mypy version checking, [#3783](https://github.com/pydantic/pydantic/issues/3783) by [@KotlinIsland](https://github.com/KotlinIsland)
* support overwriting dunder attributes of `BaseModel` instances, [#3777](https://github.com/pydantic/pydantic/issues/3777) by [@PrettyWood](https://github.com/PrettyWood)
* Added `ConstrainedDate` and `condate`, [#3740](https://github.com/pydantic/pydantic/issues/3740) by [@hottwaj](https://github.com/hottwaj)
* Support `kw_only` in dataclasses, [#3670](https://github.com/pydantic/pydantic/issues/3670) by [@detachhead](https://github.com/detachhead)
* Add comparison method for `Color` class, [#3646](https://github.com/pydantic/pydantic/issues/3646) by [@aminalaee](https://github.com/aminalaee)
* Drop support for python3.6, associated cleanup, [#3605](https://github.com/pydantic/pydantic/issues/3605) by [@samuelcolvin](https://github.com/samuelcolvin)
* created new function `to_lower_camel()` for "non pascal case" camel case, [#3463](https://github.com/pydantic/pydantic/issues/3463) by [@schlerp](https://github.com/schlerp)
* Add checks to `default` and `default_factory` arguments in Mypy plugin, [#3430](https://github.com/pydantic/pydantic/issues/3430) by [@klaa97](https://github.com/klaa97)
* fix mangling of `inspect.signature` for `BaseModel`, [#3413](https://github.com/pydantic/pydantic/issues/3413) by [@fix-inspect-signature](https://github.com/fix-inspect-signature)
* Adds the `SecretField` abstract class so that all the current and future secret fields like `SecretStr` and `SecretBytes` will derive from it, [#3409](https://github.com/pydantic/pydantic/issues/3409) by [@expobrain](https://github.com/expobrain)
* Support multi hosts validation in `PostgresDsn`, [#3337](https://github.com/pydantic/pydantic/issues/3337) by [@rglsk](https://github.com/rglsk)
* Fix parsing of very small numeric timedelta values, [#3315](https://github.com/pydantic/pydantic/issues/3315) by [@samuelcolvin](https://github.com/samuelcolvin)
* Update `SecretsSettingsSource` to respect `config.case_sensitive`, [#3273](https://github.com/pydantic/pydantic/issues/3273) by [@JeanArhancet](https://github.com/JeanArhancet)
* Add MongoDB network data source name (DSN) schema, [#3229](https://github.com/pydantic/pydantic/issues/3229) by [@snosratiershad](https://github.com/snosratiershad)
* Add support for multiple dotenv files, [#3222](https://github.com/pydantic/pydantic/issues/3222) by [@rekyungmin](https://github.com/rekyungmin)
* Raise an explicit `ConfigError` when multiple fields are incorrectly set for a single validator, [#3215](https://github.com/pydantic/pydantic/issues/3215) by [@SunsetOrange](https://github.com/SunsetOrange)
* Allow ellipsis on `Field`s inside `Annotated` for `TypedDicts` required, [#3133](https://github.com/pydantic/pydantic/issues/3133) by [@ezegomez](https://github.com/ezegomez)
* Catch overflow errors in `int_validator`, [#3112](https://github.com/pydantic/pydantic/issues/3112) by [@ojii](https://github.com/ojii)
* Adds a `__rich_repr__` method to `Representation` class which enables pretty printing with [Rich](https://github.com/willmcgugan/rich), [#3099](https://github.com/pydantic/pydantic/issues/3099) by [@willmcgugan](https://github.com/willmcgugan)
* Add percent encoding in `AnyUrl` and descendent types, [#3061](https://github.com/pydantic/pydantic/issues/3061) by [@FaresAhmedb](https://github.com/FaresAhmedb)
* `validate_arguments` decorator now supports `alias`, [#3019](https://github.com/pydantic/pydantic/issues/3019) by [@MAD-py](https://github.com/MAD-py)
* Avoid `__dict__` and `__weakref__` attributes in `AnyUrl` and IP address fields, [#2890](https://github.com/pydantic/pydantic/issues/2890) by [@nuno-andre](https://github.com/nuno-andre)
* Add ability to use `Final` in a field type annotation, [#2766](https://github.com/pydantic/pydantic/issues/2766) by [@uriyyo](https://github.com/uriyyo)
* Update requirement to `typing_extensions>=4.1.0` to guarantee `dataclass_transform` is available, [#4424](https://github.com/pydantic/pydantic/issues/4424) by [@commonism](https://github.com/commonism)
* Add Explosion and AWS to main sponsors, [#4413](https://github.com/pydantic/pydantic/issues/4413) by [@samuelcolvin](https://github.com/samuelcolvin)
* Update documentation for `copy_on_model_validation` to reflect recent changes, [#4369](https://github.com/pydantic/pydantic/issues/4369) by [@samuelcolvin](https://github.com/samuelcolvin)
* Runtime warning if `__slots__` is passed to `create_model`, `__slots__` is then ignored, [#4432](https://github.com/pydantic/pydantic/issues/4432) by [@samuelcolvin](https://github.com/samuelcolvin)
* Add type hints to `BaseSettings.Config` to avoid mypy errors, also correct mypy version compatibility notice in docs, [#4450](https://github.com/pydantic/pydantic/issues/4450) by [@samuelcolvin](https://github.com/samuelcolvin)

## v1.10.0b1 (2022-08-24)

Pre-release, see [the GitHub release](https://github.com/pydantic/pydantic/releases/tag/v1.10.0b1) for details.

## v1.10.0a2 (2022-08-24)

Pre-release, see [the GitHub release](https://github.com/pydantic/pydantic/releases/tag/v1.10.0a2) for details.

## v1.10.0a1 (2022-08-22)

Pre-release, see [the GitHub release](https://github.com/pydantic/pydantic/releases/tag/v1.10.0a1) for details.

## v1.9.2 (2022-08-11)

**Revert Breaking Change**: _v1.9.1_ introduced a breaking change where model fields were
deep copied by default, this release reverts the default behaviour to match _v1.9.0_ and before, 
while also allow deep-copy behaviour via `copy_on_model_validation = 'deep'`. See [#4092](https://github.com/pydantic/pydantic/issues/4092) for more information.

* Allow for shallow copies of model fields, `Config.copy_on_model_validation` is now a str which must be
  `'none'`, `'deep'`, or `'shallow'` corresponding to not copying, deep copy & shallow copy; default `'shallow'`, 
  [#4093](https://github.com/pydantic/pydantic/issues/4093) by [@timkpaine](https://github.com/timkpaine)

## v1.9.1 (2022-05-19)

Thank you to pydantic's sponsors:
@tiangolo, [@stellargraph](https://github.com/stellargraph), [@JonasKs](https://github.com/JonasKs), [@grillazz](https://github.com/grillazz), [@Mazyod](https://github.com/Mazyod), [@kevinalh](https://github.com/kevinalh), [@chdsbd](https://github.com/chdsbd), [@povilasb](https://github.com/povilasb), [@povilasb](https://github.com/povilasb), [@jina-ai](https://github.com/jina-ai), 
@mainframeindustries, [@robusta-dev](https://github.com/robusta-dev), [@SendCloud](https://github.com/SendCloud), [@rszamszur](https://github.com/rszamszur), [@jodal](https://github.com/jodal), [@hardbyte](https://github.com/hardbyte), [@corleyma](https://github.com/corleyma), [@daddycocoaman](https://github.com/daddycocoaman), 
@Rehket, [@jokull](https://github.com/jokull), [@reillysiemens](https://github.com/reillysiemens), [@westonsteimel](https://github.com/westonsteimel), [@primer-io](https://github.com/primer-io), [@koxudaxi](https://github.com/koxudaxi), [@browniebroke](https://github.com/browniebroke), [@stradivari96](https://github.com/stradivari96), 
@adriangb, [@kamalgill](https://github.com/kamalgill), [@jqueguiner](https://github.com/jqueguiner), [@dev-zero](https://github.com/dev-zero), [@datarootsio](https://github.com/datarootsio), [@RedCarpetUp](https://github.com/RedCarpetUp)
for their kind support.

* Limit the size of `generics._generic_types_cache` and `generics._assigned_parameters` 
  to avoid unlimited increase in memory usage, [#4083](https://github.com/pydantic/pydantic/issues/4083) by [@samuelcolvin](https://github.com/samuelcolvin)
* Add Jupyverse and FPS as Jupyter projects using pydantic, [#4082](https://github.com/pydantic/pydantic/issues/4082) by [@davidbrochart](https://github.com/davidbrochart)
* Speedup `__isinstancecheck__` on pydantic models when the type is not a model, may also avoid memory "leaks", [#4081](https://github.com/pydantic/pydantic/issues/4081) by [@samuelcolvin](https://github.com/samuelcolvin)
* Fix in-place modification of `FieldInfo` that caused problems with PEP 593 type aliases, [#4067](https://github.com/pydantic/pydantic/issues/4067) by [@adriangb](https://github.com/adriangb)
* Add support for autocomplete in VS Code via `__dataclass_transform__` when using `pydantic.dataclasses.dataclass`, [#4006](https://github.com/pydantic/pydantic/issues/4006) by [@giuliano-oliveira](https://github.com/giuliano-oliveira)
* Remove benchmarks from codebase and docs, [#3973](https://github.com/pydantic/pydantic/issues/3973) by [@samuelcolvin](https://github.com/samuelcolvin)
* Typing checking with pyright in CI, improve docs on vscode/pylance/pyright, [#3972](https://github.com/pydantic/pydantic/issues/3972) by [@samuelcolvin](https://github.com/samuelcolvin)
* Fix nested Python dataclass schema regression, [#3819](https://github.com/pydantic/pydantic/issues/3819) by [@himbeles](https://github.com/himbeles)
* Update documentation about lazy evaluation of sources for Settings, [#3806](https://github.com/pydantic/pydantic/issues/3806) by [@garyd203](https://github.com/garyd203)
* Prevent subclasses of bytes being converted to bytes, [#3706](https://github.com/pydantic/pydantic/issues/3706) by [@samuelcolvin](https://github.com/samuelcolvin)
* Fixed "error checking inheritance of" when using PEP585 and PEP604 type hints, [#3681](https://github.com/pydantic/pydantic/issues/3681) by [@aleksul](https://github.com/aleksul)
* Allow self referencing `ClassVar`s in models, [#3679](https://github.com/pydantic/pydantic/issues/3679) by [@samuelcolvin](https://github.com/samuelcolvin)
* **Breaking Change, see [#4106](https://github.com/pydantic/pydantic/issues/4106)**: Fix issue with self-referencing dataclass, [#3675](https://github.com/pydantic/pydantic/issues/3675) by [@uriyyo](https://github.com/uriyyo)
* Include non-standard port numbers in rendered URLs, [#3652](https://github.com/pydantic/pydantic/issues/3652) by [@dolfinus](https://github.com/dolfinus)
* `Config.copy_on_model_validation` does a deep copy and not a shallow one, [#3641](https://github.com/pydantic/pydantic/issues/3641) by [@PrettyWood](https://github.com/PrettyWood)
* fix: clarify that discriminated unions do not support singletons, [#3636](https://github.com/pydantic/pydantic/issues/3636) by [@tommilligan](https://github.com/tommilligan)
* Add `read_text(encoding='utf-8')` for `setup.py`, [#3625](https://github.com/pydantic/pydantic/issues/3625) by [@hswong3i](https://github.com/hswong3i)
* Fix JSON Schema generation for Discriminated Unions within lists, [#3608](https://github.com/pydantic/pydantic/issues/3608) by [@samuelcolvin](https://github.com/samuelcolvin)

## v1.9.0 (2021-12-31)

Thank you to pydantic's sponsors:
@sthagen, [@timdrijvers](https://github.com/timdrijvers), [@toinbis](https://github.com/toinbis), [@koxudaxi](https://github.com/koxudaxi), [@ginomempin](https://github.com/ginomempin), [@primer-io](https://github.com/primer-io), [@and-semakin](https://github.com/and-semakin), [@westonsteimel](https://github.com/westonsteimel), [@reillysiemens](https://github.com/reillysiemens),
@es3n1n, [@jokull](https://github.com/jokull), [@JonasKs](https://github.com/JonasKs), [@Rehket](https://github.com/Rehket), [@corleyma](https://github.com/corleyma), [@daddycocoaman](https://github.com/daddycocoaman), [@hardbyte](https://github.com/hardbyte), [@datarootsio](https://github.com/datarootsio), [@jodal](https://github.com/jodal), [@aminalaee](https://github.com/aminalaee), [@rafsaf](https://github.com/rafsaf), 
@jqueguiner, [@chdsbd](https://github.com/chdsbd), [@kevinalh](https://github.com/kevinalh), [@Mazyod](https://github.com/Mazyod), [@grillazz](https://github.com/grillazz), [@JonasKs](https://github.com/JonasKs), [@simw](https://github.com/simw), [@leynier](https://github.com/leynier), [@xfenix](https://github.com/xfenix)
for their kind support.

### Highlights

* add Python 3.10 support, [#2885](https://github.com/pydantic/pydantic/issues/2885) by [@PrettyWood](https://github.com/PrettyWood)
* [Discriminated unions](https://docs.pydantic.dev/usage/types/#discriminated-unions-aka-tagged-unions), [#619](https://github.com/pydantic/pydantic/issues/619) by [@PrettyWood](https://github.com/PrettyWood)
* [`Config.smart_union` for better union logic](https://docs.pydantic.dev/usage/model_config/#smart-union), [#2092](https://github.com/pydantic/pydantic/issues/2092) by [@PrettyWood](https://github.com/PrettyWood)
* Binaries for Macos M1 CPUs, [#3498](https://github.com/pydantic/pydantic/issues/3498) by [@samuelcolvin](https://github.com/samuelcolvin)
* Complex types can be set via [nested environment variables](https://docs.pydantic.dev/usage/settings/#parsing-environment-variable-values), e.g. `foo___bar`, [#3159](https://github.com/pydantic/pydantic/issues/3159) by [@Air-Mark](https://github.com/Air-Mark)
* add a dark mode to _pydantic_ documentation, [#2913](https://