Is there a real reason to use dataclasses over dicts for

Back to list2026-06-21
You

Is there a real reason to use dataclasses over dicts for internal data?

ChatGPT

Typos become errors instead of silent None, and the field list is documentation that cannot drift. The cost is a small allocation overhead, which matters only in the hottest loops. With slots=True even that mostly disappears.

You

What would you skip entirely?

ChatGPT

The reporting layer, until something forces it. It is the part that feels productive to build and the part nobody opens twice.