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

Method register_group_dep

mypyc/codegen/emit.py:329–339  ·  view source on GitHub ↗

Record `cl`'s defining group as a cross-group dep, if any. Call this when emitting code that refers to `cl`'s struct layout: the .c file consuming that layout needs the defining group's `__native_*.h` included, and group_deps drives which headers get pulled in.

(self, cl: ClassIR)

Source from the content-addressed store, hash-verified

327 return self.get_module_group_prefix(obj.module_name)
328
329 def register_group_dep(self, cl: ClassIR) -> None:
330 """Record `cl`'s defining group as a cross-group dep, if any.
331
332 Call this when emitting code that refers to `cl`'s struct
333 layout: the .c file consuming that layout needs the defining
334 group's `__native_*.h` included, and group_deps drives which
335 headers get pulled in.
336 """
337 target_group = self.context.group_map.get(cl.module_name)
338 if target_group and target_group != self.context.group_name:
339 self.context.group_deps.add(target_group)
340
341 def static_name(self, id: str, module: str | None, prefix: str = STATIC_PREFIX) -> str:
342 """Create name of a C static variable.

Callers 1

get_attr_exprMethod · 0.80

Calls 2

getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected