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

Class TupleSet

mypyc/ir/ops.py:1049–1078  ·  view source on GitHub ↗

dest = (reg, ...) (for fixed-length tuple)

Source from the content-addressed store, hash-verified

1047
1048@final
1049class TupleSet(RegisterOp):
1050 """dest = (reg, ...) (for fixed-length tuple)"""
1051
1052 error_kind = ERR_NEVER
1053
1054 def __init__(self, items: list[Value], line: int) -> None:
1055 super().__init__(line)
1056 self.items = items
1057 # Don't keep track of the fact that an int is short after it
1058 # is put into a tuple, since we don't properly implement
1059 # runtime subtyping for tuples.
1060 self.tuple_type = RTuple(
1061 [
1062 arg.type if not is_short_int_rprimitive(arg.type) else int_rprimitive
1063 for arg in items
1064 ]
1065 )
1066 self.type = self.tuple_type
1067
1068 def sources(self) -> list[Value]:
1069 return self.items.copy()
1070
1071 def stolen(self) -> list[Value]:
1072 return self.items.copy()
1073
1074 def set_sources(self, new: list[Value]) -> None:
1075 self.items = new[:]
1076
1077 def accept(self, visitor: OpVisitor[T]) -> T:
1078 return visitor.visit_tuple_set(self)
1079
1080
1081@final

Callers 6

begin_bodyMethod · 0.90
vec_popFunction · 0.90
create_non_ext_infoMethod · 0.90
transform_tuple_exprFunction · 0.90
coerceMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…