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

Function symbol_to_value

Tools/jit/_stencils.py:400–412  ·  view source on GitHub ↗

Convert a symbol name to a HoleValue and a symbol name. Some symbols (starting with "_JIT_") are special and are converted to their own HoleValues.

(symbol: str)

Source from the content-addressed store, hash-verified

398
399
400def symbol_to_value(symbol: str) -> tuple[HoleValue, str | None]:
401 """
402 Convert a symbol name to a HoleValue and a symbol name.
403
404 Some symbols (starting with "_JIT_") are special and are converted to their
405 own HoleValues.
406 """
407 if symbol.startswith("_JIT_"):
408 try:
409 return HoleValue[symbol.removeprefix("_JIT_")], None
410 except KeyError:
411 pass
412 return HoleValue.ZERO, symbol
413
414
415def _signed(value: int) -> int:

Callers 2

Calls 2

startswithMethod · 0.45
removeprefixMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…