MCPcopy Index your code
hub / github.com/python/mypy / concat_tuples

Method concat_tuples

mypy/checkexpr.py:3524–3529  ·  view source on GitHub ↗

Concatenate two fixed length tuples.

(self, left: TupleType, right: TupleType)

Source from the content-addressed store, hash-verified

3522 return typ.copy_modified(last_known_value=LiteralType(value=value, fallback=typ))
3523
3524 def concat_tuples(self, left: TupleType, right: TupleType) -> TupleType:
3525 """Concatenate two fixed length tuples."""
3526 assert not (find_unpack_in_list(left.items) and find_unpack_in_list(right.items))
3527 return TupleType(
3528 items=left.items + right.items, fallback=self.named_type("builtins.tuple")
3529 )
3530
3531 def visit_int_expr(self, e: IntExpr) -> Type:
3532 """Type check an integer literal (trivial)."""

Callers 1

visit_op_exprMethod · 0.95

Calls 3

named_typeMethod · 0.95
find_unpack_in_listFunction · 0.90
TupleTypeClass · 0.90

Tested by

no test coverage detected