class documentation

The union type Union[T1, ..., Tn] (at least one type argument).

Class Method deserialize Undocumented
Static Method make_union Undocumented
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method accept Undocumented
Method can_be_false_default Undocumented
Method can_be_true_default Undocumented
Method has_readable_member For a tree of unions of instances, check whether all instances have a given member.
Method length Undocumented
Method relevant_items Removes NoneTypes from Unions when strict Optional checking is off.
Method serialize Undocumented
Class Variable __slots__ Undocumented
Instance Variable is_evaluated Undocumented
Instance Variable items Undocumented
Instance Variable uses_pep604_syntax Undocumented

Inherited from Type (via ProperType):

Method __repr__ Undocumented
Method can_be_false.setter Undocumented
Method can_be_true.setter Undocumented
Method is_singleton_type Undocumented
Property can_be_false Undocumented
Property can_be_true Undocumented
Instance Variable _can_be_false Undocumented
Instance Variable _can_be_true Undocumented

Inherited from Context (via ProperType, Type):

Method set_line If target is a node, pull line (and column) information into this node. If column is specified, this will override any column information coming from a node.
Instance Variable column Undocumented
Instance Variable end_column Undocumented
Instance Variable end_line Undocumented
Instance Variable line Undocumented
@classmethod
def deserialize(cls, data: JsonDict) -> UnionType: (source)

Undocumented

@overload
@staticmethod
def make_union(items: Sequence[ProperType], line: int = -1, column: int = -1) -> ProperType:
@overload
@staticmethod
def make_union(items: Sequence[Type], line: int = -1, column: int = -1) -> Type:
@staticmethod
(source)

Undocumented

def __eq__(self, other: object) -> bool: (source)

Undocumented

def __hash__(self) -> int: (source)

Undocumented

def __init__(self, items: Sequence[Type], line: int = -1, column: int = -1, is_evaluated: bool = True, uses_pep604_syntax: bool = False): (source)

Undocumented

def accept(self, visitor: TypeVisitor[T]) -> T: (source)

Undocumented

def can_be_false_default(self) -> bool: (source)

Undocumented

def can_be_true_default(self) -> bool: (source)

Undocumented

def has_readable_member(self, name: str) -> bool: (source)

For a tree of unions of instances, check whether all instances have a given member. TODO: Deal with attributes of TupleType etc. TODO: This should probably be refactored to go elsewhere.

def length(self) -> int: (source)

Undocumented

def relevant_items(self) -> list[Type]: (source)

Removes NoneTypes from Unions when strict Optional checking is off.

def serialize(self) -> JsonDict: (source)

Undocumented

__slots__: tuple[str, ...] = (source)

Undocumented

is_evaluated = (source)

Undocumented

Undocumented

uses_pep604_syntax = (source)

Undocumented