Designing with dataclasses

Python dictionaries are available without an import and extremely flexible, which means many Python programmers default to representing data as a dict. Here&rsquo;s why and when you should use dataclasses instead. Note: I&rsquo;m using dataclass here since it&rsquo;s in the standard library. If you&rsquo;re already using a similar 3rd-party library like the excellent attrs the advice here still…