Talk Python To Me cover image

#466: Pydantic Performance Tips

Talk Python To Me

00:00

Exploring Discriminated Unions in Pydantic

The chapter delves into the concept of discriminated unions in Pydantic models, where discriminators like string or callable types are crucial for efficient validation. It discusses using discriminators for nested models to enhance error handling and performance, showcasing examples like cat and dog models with pet type fields. The chapter also explores performance optimization techniques in Pydantic, such as 'skip validation' annotations and utilizing SIMD for faster JSON parsing.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app