Talk

From Pydantic V1 to V2

Saturday, May 25

11:00 - 11:30
RoomPanino
LanguageEnglish
Audience levelIntermediate
Elevator pitch

Pydantic 2.0’s release, featuring a 17x performance boost from partial rewriting in Rust, reshapes Python app development. This session explores the benefits and trade-offs of Pydantic in Rust, appealing to Python developers keen on Python-Rust integration.

Abstract

A crucial element in many Python applications is Pydantic, and its significance has grown with version 2. The rebuild of internals, evidenced by benchmarks showing a remarkable 17x performance improvement, marks a wow-worthy milestone! Pydantic 2.0’s release, coupled with partial rewriting in Rust and refactoring into Pydantic core and top-level Pydantic in Python, signifies major developments. In reality, the alpha release of Pydantic 2 is now available, and these changes could notably impact libraries like FastAPI and Beanie.

To understand the implications of these modifications, I take the opportunity to discuss the Pydantic library and the transition from V1 to V2. This talk will delve into how the adoption of Rust has entirely transformed Pydantic’s architecture, making it more extendable, maintainable, and significantly boosting its performance. Before diving into Rust’s impact, I’ll provide a brief introduction to Pydantic and the new features in Pydantic V2. The core of the discussion will focus on highlighting the advantages and drawbacks of creating libraries like Pydantic in Rust, using examples from the Pydantic V2 codebase. I’ll explore the trade-offs and design considerations encountered when using Rust to create logic rather than Python.

This session is relevant to any Python developer interested in integrating Python and Rust. No prior understanding of Rust or Pydantic is required. I’m confident that you’ll find the talk lively and insightful.

TagsFlask, Django, FastAPI, Rust
Participant

Hemangi Subodh Karchalkar

I’m Hemangi Karchalkar, a senior software developer at Epam Systems, weaving Python magic for five years. By day, I’m your go-to coding junkie, and by night, I moonlight as a Python mentor, adding a sprinkle of jokes to the learning mix. Multitasking is my superpower, and I firmly believe that laughter is the best debugger. In the world of brackets and semicolons, I bring a dose of humor, making coding an entertaining adventure. Join me for a Python journey where code and comedy collide, bugs are no match for wit, and mentorship comes with a side of humor.