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

Class IncRef

mypyc/ir/ops.py:581–598  ·  view source on GitHub ↗

Increase reference count (inc_ref src).

Source from the content-addressed store, hash-verified

579
580@final
581class IncRef(RegisterOp):
582 """Increase reference count (inc_ref src)."""
583
584 error_kind = ERR_NEVER
585
586 def __init__(self, src: Value, line: int = -1) -> None:
587 assert src.type.is_refcounted
588 super().__init__(line)
589 self.src = src
590
591 def sources(self) -> list[Value]:
592 return [self.src]
593
594 def set_sources(self, new: list[Value]) -> None:
595 (self.src,) = new
596
597 def accept(self, visitor: OpVisitor[T]) -> T:
598 return visitor.visit_inc_ref(self)
599
600
601@final

Callers 7

test_inc_refMethod · 0.90
test_inc_ref_intMethod · 0.90
test_inc_ref_noneMethod · 0.90
test_inc_ref_boolMethod · 0.90
maybe_append_inc_refFunction · 0.90
add_blockFunction · 0.90

Calls

no outgoing calls

Tested by 5

test_inc_refMethod · 0.72
test_inc_ref_intMethod · 0.72
test_inc_ref_noneMethod · 0.72
test_inc_ref_boolMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…