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

Function generate_side_table_for_class

mypyc/codegen/emitclass.py:1047–1055  ·  view source on GitHub ↗
(
    cl: ClassIR, name: str, type: str, slots: dict[str, str], emitter: Emitter
)

Source from the content-addressed store, hash-verified

1045
1046
1047def generate_side_table_for_class(
1048 cl: ClassIR, name: str, type: str, slots: dict[str, str], emitter: Emitter
1049) -> str | None:
1050 name = f"{cl.name_prefix(emitter.names)}_{name}"
1051 emitter.emit_line(f"static {type} {name} = {{")
1052 for field, value in slots.items():
1053 emitter.emit_line(f".{field} = {value},")
1054 emitter.emit_line("};")
1055 return name
1056
1057
1058def generate_getseter_declarations(cl: ClassIR, emitter: Emitter) -> None:

Callers 1

generate_classFunction · 0.85

Calls 3

name_prefixMethod · 0.80
emit_lineMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…