3 ms·
Right. It takes equal effort to define a named tuple, typed dict or dataclass. Mostly people just reach for the tool that does what they want, named tuples for
by mont_tag 2y ago
Right. It takes equal effort to define a named tuple, typed dict or dataclass.
Mostly people just reach for the tool that does what they want, named tuples for tuply stuff, typed dicts for mapping applications, and dataclasses when you actually want a class.