News for hackers. Stuff that matters.
Re:Don't let dicts spoil your code by seabrookmx on Wednesday October 09, 2024 @12:56AM (#41784628)
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.
Re:Don't let dicts spoil your code by psd1 on Saturday October 12, 2024 @01:34PM (#41820867)
You know about frozenset, right? Dataclasses can be immutable.

It's python, so take that with a grain of salt.