class documentation

class TupleType(ProperType): (source)

View In Hierarchy

The tuple type Tuple[T1, ..., Tn] (at least one type argument).

Instance variables:

items: Tuple item types partial_fallback: The (imprecise) underlying instance type that is used

for non-tuple methods. This is generally builtins.tuple[Any] for regular tuples, but it's different for named tuples and classes with a tuple base class. Use mypy.typeops.tuple_fallback to calculate the precise fallback type derived from item types.

implicit: If True, derived from a tuple expression (t,....) instead of Tuple[t, ...]

Class Method deserialize Undocumented
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method accept Undocumented
Method copy​_modified Undocumented
Method length Undocumented
Method serialize Undocumented
Method slice Undocumented
Class Variable __slots__ Undocumented
Instance Variable can​_be​_false Undocumented
Instance Variable can​_be​_true Undocumented
Instance Variable implicit Undocumented
Instance Variable items Undocumented
Instance Variable partial​_fallback Undocumented

Inherited from Type (via ProperType):

Method __repr__ Undocumented
Method can​_be​_false​_default Undocumented
Method can​_be​_true​_default Undocumented

Inherited from Context (via ProperType, Type):

Method get​_column Don't use. Use x.column.
Method get​_line Don't use. Use x.line.
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​_line Undocumented
Instance Variable line Undocumented
@classmethod
def deserialize(cls, data): (source)

Undocumented

Parameters
data:JsonDictUndocumented
Returns
TupleTypeUndocumented
def __eq__(self, other): (source)

Undocumented

Parameters
other:objectUndocumented
Returns
boolUndocumented
def __hash__(self): (source)

Undocumented

Returns
intUndocumented
def __init__(self, items, fallback, line=-1, column=-1, implicit=False): (source)

Undocumented

Parameters
items:List[Type]Undocumented
fallback:InstanceUndocumented
line:intUndocumented
column:intUndocumented
implicit:boolUndocumented
def accept(self, visitor): (source)

Undocumented

Parameters
visitor:TypeVisitor[T]Undocumented
Returns
TUndocumented
def copy_modified(self, *, fallback=None, items=None): (source)

Undocumented

Parameters
fallback:Optional[Instance]Undocumented
items:Optional[List[Type]]Undocumented
Returns
TupleTypeUndocumented
def length(self): (source)

Undocumented

Returns
intUndocumented
def serialize(self): (source)

Undocumented

Returns
JsonDictUndocumented
def slice(self, begin, end, stride): (source)

Undocumented

Parameters
begin:Optional[int]Undocumented
end:Optional[int]Undocumented
stride:Optional[int]Undocumented
Returns
TupleTypeUndocumented
__slots__: tuple[str, ...] = (source)

Undocumented

can_be_false = (source)

Undocumented

can_be_true = (source)

Undocumented

implicit = (source)

Undocumented

items = (source)

Undocumented

partial_fallback = (source)

Undocumented