$ the-wire · showcase
Pydantic adds deque core schema
By RepoJournal · Filed · About FastAPI & Pydantic
Pydantic now has a core schema for the deque type, letting constraints apply properly.
Pydantic merged a new deque core schema [1] so that constraints now apply properly to collections.deque fields. The change also adds type inference for deque during serialization. Previously, deque was validated via a generic sequence schema, so constraints like max length or item constraints did not behave exactly as expected for the concrete type.
Action items
- → Review any code relying on deque constraints for behavior changes pydantic/pydantic [monitor]
References
- [1] Add a `deque` core schema ↗ pydantic/pydantic