self.data is typed T | None on the dataclass but the Ok-branch invariant (enforced by __post_init__) guarantees it is T whenever self.ok is True. Cast explicitly instead of leaving mypy to infer T | None. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>