William Woodruff personal blog

Approximating sum types in Python with Pydantic

TL;DR: You can use Pydantic’s support for tagged unions to approximate sum types in Python; go right to Sum types in Python (and onwards) to see how it’s done.
Points
158
HN comments
97
Submissions
1
Cited by
0 commenters

Software EngineeringProgramming Languages2024

On Hacker News

SubmittedTitle on HNPointsComments
Aug 12, 2024Approximating sum types in Python with Pydantic by woodruffw15897

More from William Woodruff

All 19 posts →

Related posts from the same era