Type hints declare expectations (PEP 484, enforced by mypy strict). @dataclass is sugar for a class whose primary purpose is holding values: init, repr, eq are auto-generated. Combine: typed fields + auto-generated plumbing + Pydantic for runtime validation.
@dataclass class User: id: int; email: str; optional_age: int | None
Pydantic v2: BaseModel validates on construction; .model_dump() for dict projection.
mypy —strict catches Optional fields used as None without an isinstance check.
class fields, typed -> @dataclass
typed + runtime check -> Pydantic BaseModel
mypy --strict then enforces the contract
Type hints + dataclass = typed data; Pydantic adds runtime validation; mypy checks both ends.