I have a Union type PossibleOption composed of n dataclasses, and I want to create a dictionary where the keys are instances of these classes. I need to statically check with mypy that the dictionary includes a key for each option in the Union. Here’s my current code: from dataclasses import dataclass from typing import […]