This PR allows mypy to understand that the Nullable type is always false-y, so that mypy finds this valid:
@dataclass
class Example:
name: Nullable[str | None] = None
example = Example("sienna")
assert example.name # If this assert passes we know `name` is a string (because it isn't None or Nullable)
name_upper = example.name.upper()
This PR allows mypy to understand that the
Nullable
type is always false-y, so that mypy finds this valid: