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

Class Assign

mypyc/ir/ops.py:326–347  ·  view source on GitHub ↗

Assign a value to a Register (dest = src).

Source from the content-addressed store, hash-verified

324
325@final
326class Assign(BaseAssign):
327 """Assign a value to a Register (dest = src)."""
328
329 error_kind = ERR_NEVER
330
331 def __init__(self, dest: Register, src: Value, line: int = -1) -> None:
332 super().__init__(dest, line)
333 self.src = src
334
335 def sources(self) -> list[Value]:
336 return [self.src]
337
338 def set_sources(self, new: list[Value]) -> None:
339 (self.src,) = new
340
341 def stolen(self) -> list[Value]:
342 if not self.dest.type.is_refcounted:
343 return []
344 return [self.src]
345
346 def accept(self, visitor: OpVisitor[T]) -> T:
347 return visitor.visit_assign(self)
348
349
350@final

Callers 15

vec_createFunction · 0.90
vec_item_typeFunction · 0.90
assign_if_nullMethod · 0.90
assignMethod · 0.90
try_finally_entry_blocksFunction · 0.90
transform_del_itemFunction · 0.90
assignMethod · 0.90
coerceMethod · 0.90

Calls

no outgoing calls

Tested by 10

test_invalid_assignMethod · 0.72
test_duplicate_opMethod · 0.72
test_assignMethod · 0.72
test_integerMethod · 0.72
test_assign_intMethod · 0.72
test_long_unsignedMethod · 0.72
test_long_signedMethod · 0.72
test_c_stringMethod · 0.72
test_registerMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…