3 ms·
Subclassing NamedTuple is very ergonomic, and given they're immutable unlike data classes I often reach for them by default. I still use Pydantic when I want c
by seabrookmx 2y ago
Subclassing NamedTuple is very ergonomic, and given they're immutable unlike data classes I often reach for them by default. I still use Pydantic when I want custom validation or when it ties into another lib like FastAPI.
- psd1 2y agoYou know about frozenset, right? Dataclasses can be immutable. It's python, so take that with a grain of salt.