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

Class InitStatic

mypyc/ir/ops.py:1016–1045  ·  view source on GitHub ↗

static = value :: static Initialize a C static variable/pointer. See everything in LoadStatic.

Source from the content-addressed store, hash-verified

1014
1015@final
1016class InitStatic(RegisterOp):
1017 """static = value :: static
1018
1019 Initialize a C static variable/pointer. See everything in LoadStatic.
1020 """
1021
1022 error_kind = ERR_NEVER
1023
1024 def __init__(
1025 self,
1026 value: Value,
1027 identifier: str,
1028 module_name: str | None = None,
1029 namespace: str = NAMESPACE_STATIC,
1030 line: int = -1,
1031 ) -> None:
1032 super().__init__(line)
1033 self.identifier = identifier
1034 self.module_name = module_name
1035 self.namespace = namespace
1036 self.value = value
1037
1038 def sources(self) -> list[Value]:
1039 return [self.value]
1040
1041 def set_sources(self, new: list[Value]) -> None:
1042 (self.value,) = new
1043
1044 def accept(self, visitor: OpVisitor[T]) -> T:
1045 return visitor.visit_init_static(self)
1046
1047
1048@final

Callers 7

gen_importMethod · 0.90
init_final_staticMethod · 0.90
init_type_varMethod · 0.90
calculate_arg_defaultsFunction · 0.90
finalizeMethod · 0.90
allocate_classFunction · 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…