MCPcopy Index your code
hub / github.com/python/cpython / kind_to_text

Method kind_to_text

Tools/scripts/summarize_stats.py:284–298  ·  view source on GitHub ↗
(kind: int, opcode: str)

Source from the content-addressed store, hash-verified

282
283 def get_specialization_failure_kinds(self, opcode: str) -> dict[str, int]:
284 def kind_to_text(kind: int, opcode: str):
285 if kind <= 8:
286 return pretty(self._defines[kind][0])
287 if opcode == "LOAD_SUPER_ATTR":
288 opcode = "SUPER"
289 elif opcode.endswith("ATTR"):
290 opcode = "ATTR"
291 elif opcode in ("FOR_ITER", "GET_ITER", "SEND"):
292 opcode = "ITER"
293 elif opcode.endswith("SUBSCR"):
294 opcode = "SUBSCR"
295 for name in self._defines[kind]:
296 if name.startswith(opcode):
297 return pretty(name[len(opcode) + 1 :])
298 return "kind " + str(kind)
299
300 family_stats = self._get_stats_for_opcode(opcode)
301

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
prettyFunction · 0.70
endswithMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected