#Dataclasses
2 posts tagged Dataclasses. All posts
dataclasses, attrs or Pydantic: picking a Python data class libraryThe same order model written with dataclasses, attrs and Pydantic: frozen objects, slots, defaults, validation, conversion and JSON, and when to use each.
Structural pattern matching in Python: matching dicts, sequences and classesUse match/case to parse JSON events and command tuples, match classes with __match_args__, add guards, and avoid the capture-vs-constant trap.
© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)