this post was submitted on 04 Jul 2025
12 points (92.9% liked)

Python

7300 readers
4 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] arjache@fedia.io 5 points 1 week ago

For validation and/or (de)serialization: pydantic.

Otherwise, dataclasses.

I also like to replace tuples with NamedTuple, but I tend to use tuples a lot in the first place. It’s generally recommended to use dataclasses instead if you don’t specifically need tuple-like behavior.