dataclass vs NamedTuple vs TypedDict vs Pydantic: how do you choose?
Interview insights are lockedSee how often this is asked and which companies asked it with Buncho Pro.Compare @dataclass, typing.NamedTuple, typing.TypedDict and pydantic.BaseModel.
- What does each give you, and what does it cost?
- Which would you use for: an internal training config, a row of results returned by a function, JSON from an LLM, and a high-volume inner-loop record?
- Why does
@dataclassrejecttags: list = []?