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

Class GetElement

mypyc/ir/ops.py:1698–1719  ·  view source on GitHub ↗

Get the value of a struct element from a struct value.

Source from the content-addressed store, hash-verified

1696
1697@final
1698class GetElement(RegisterOp):
1699 """Get the value of a struct element from a struct value."""
1700
1701 error_kind = ERR_NEVER
1702 is_borrowed = True
1703
1704 def __init__(self, src: Value, field: str, line: int = -1) -> None:
1705 super().__init__(line)
1706 assert isinstance(src.type, (RStruct, RVec))
1707 self.type = src.type.field_type(field)
1708 self.src = src
1709 self.src_type = src.type
1710 self.field = field
1711
1712 def sources(self) -> list[Value]:
1713 return [self.src]
1714
1715 def set_sources(self, new: list[Value]) -> None:
1716 (self.src,) = new
1717
1718 def accept(self, visitor: OpVisitor[T]) -> T:
1719 return visitor.visit_get_element(self)
1720
1721
1722@final

Callers 3

convert_to_t_ext_itemFunction · 0.90
convert_from_t_ext_itemFunction · 0.90
get_elementMethod · 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…