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

# pydantic

<div style="border: 2px solid #005f99; padding: 15px; background-color: #e6f3ff; color: #003d66; font-weight: bold; font-size: 1.2em;">
  ℹ️ <strong>IMPORTANT NOTICE:</strong>  
  This project is <strong>NOT</strong> the official Pydantic package. It is a reupload of the original Pydantic repository at commit <a href="https://github.com/pydantic/pydantic/commit/d9c2af3" style="color: #003d66; text-decoration: underline;">d9c2af3</a>.  
  The purpose of this package is to allow Pydantic 1.x to coexist with Pydantic 2.x, by renaming the package to <strong>pydantic1</strong>.  
  All functionality remains the same as the original Pydantic 1.x, and this fork introduces no new features or changes, other than renaming the imports to avoid version conflicts.  
</div>

[![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.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://github.com/pydantic/pydantic/issues/2913) by [@gbdlin](https://github.com/gbdlin)
* Add support for autocomplete in VS Code via `__dataclass_transform__`, [#2721](https://github.com/pydantic/pydantic/issues/2721) by [@tiangolo](https://github.com/tiangolo)
* Add "exclude" as a field parameter so that it can be configured using model config, [#660](https://github.com/pydantic/pydantic/issues/660) by [@daviskirk](https://github.com/daviskirk)

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

* Apply `update_forward_refs` to `Config.json_encodes` prevent name clashes in types defined via strings, [#3583](https://github.com/pydantic/pydantic/issues/3583) by [@samuelcolvin](https://github.com/samuelcolvin)
* Extend pydantic's mypy plugin to support mypy versions `0.910`, `0.920`, `0.921` & `0.930`, [#3573](https://github.com/pydantic/pydantic/issues/3573) & [#3594](https://github.com/pydantic/pydantic/issues/3594) by [@PrettyWood](https://github.com/PrettyWood), [@christianbundy](https://github.com/christianbundy), [@samuelcolvin](https://github.com/samuelcolvin)

### v1.9.0a2 (2021-12-24) Changes

* support generic models with discriminated union, [#3551](https://github.com/pydantic/pydantic/issues/3551) by [@PrettyWood](https://github.com/PrettyWood)
* keep old behaviour of `json()` by default, [#3542](https://github.com/pydantic/pydantic/issues/3542) by [@PrettyWood](https://github.com/PrettyWood)
* Removed typing-only `__root__` attribute from `BaseModel`, [#3540](https://github.com/pydantic/pydantic/issues/3540) by [@layday](https://github.com/layday)
* Build Python 3.10 wheels, [#3539](https://github.com/pydantic/pydantic/issues/3539) by [@mbachry](https://github.com/mbachry)
* Fix display of `extra` fields with model `__repr__`, [#3234](https://github.com/pydantic/pydantic/issues/3234) by [@cocolman](https://github.com/cocolman)
* models copied via `Config.copy_on_model_validation` always have all fields, [#3201](https://github.com/pydantic/pydantic/issues/3201) by [@PrettyWood](https://github.com/PrettyWood)
* nested ORM from nested dictionaries, [#3182](https://github.com/pydantic/pydantic/issues/3182) by [@PrettyWood](https://github.com/PrettyWood)
* fix link to discriminated union section by [@PrettyWood](https://github.com/PrettyWood)

### v1.9.0a1 (2021-12-18) Changes

* Add support for `Decimal`-specific validation configurations in `Field()`, additionally to using `condecimal()`, 
  to allow better support from editors and tooling, [#3507](https://github.com/pydantic/pydantic/issues/3507) by [@tiangolo](https://github.com/tiangolo)
* Add `arm64` binaries suitable for MacOS with an M1 CPU to PyPI, [#3498](https://github.com/pydantic/pydantic/issues/3498) by [@samuelcolvin](https://github.com/samuelcolvin)
* Fix issue where `None` was considered invalid when using a `Union` type containing `Any` or `object`, [#3444](https://github.com/pydantic/pydantic/issues/3444) by [@tharradine](https://github.com/tharradine)
* When generating field schema, pass optional `field` argument (of type
  `pydantic.fields.ModelField`) to `__modify_schema__()` if present, [#3434](https://github.com/pydantic/pydantic/issues/3434) by [@jasujm](https://github.com/jasujm)
* Fix issue when pydantic fail to parse `typing.ClassVar` string type annotation, [#3401](https://github.com/pydantic/pydantic/issues/3401) by [@uriyyo](https://github.com/uriyyo)
* Mention Python >= 3.9.2 as an alternative to `typing_extensions.TypedDict`, [#3374](https://github.com/pydantic/pydantic/issues/3374) by [@BvB93](https://github.com/BvB93)
* Changed the validator method name in the [Custom Errors example](https://docs.pydantic.dev/usage/models/#custom-errors) 
  to more accurately describe what the validator is doing; changed from `name_must_contain_space` to ` value_must_equal_bar`, [#3327](https://github.com/pydantic/pydantic/issues/3327) by [@michaelrios28](https://github.com/michaelrios28)
* Add `AmqpDsn` class, [#3254](https://github.com/pydantic/pydantic/issues/3254) by [@kludex](https://github.com/kludex)
* Always use `Enum` value as default in generated JSON schema, [#3190](https://github.com/pydantic/pydantic/issues/3190) by [@joaommartins](https://github.com/joaommartins)
* Add support for Mypy 0.920, [#3175](https://github.com/pydantic/pydantic/issues/3175) by [@christianbundy](https://github.com/christianbundy)
* `validate_arguments` now supports `extra` customization (used to always be `Extra.forbid`), [#3161](https://github.com/pydantic/pydantic/issues/3161) by [@PrettyWood](https://github.com/PrettyWood)
* Complex types can be set by nested environment variables, [#3159](https://github.com/pydantic