Dart has "late variables" , swift has "Implicitly Unwrapped Optionals".
Does Python have something equivalent?
That means, something like myvar: Late[str] = None
that would indicate that I know that all access to myvar later on will be after it is initialized to a non-None value.
My use case:
@dataclass
class Flag:
name: Optional[str] = dataclasses.field(init=False, default=None)
default_value: Any
value_type: Type
description: str = ""
Flag.name is initialized by a "friend" class, and all access to Flag is through that friend class, so sure that outside of this module all access is not to an Optional, but to an actual str.