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

Function compile_and_marshal

Programs/_freeze_module.py:23–27  ·  view source on GitHub ↗
(name: str, text: bytes)

Source from the content-addressed store, hash-verified

21
22
23def compile_and_marshal(name: str, text: bytes) -> bytes:
24 filename = f"<frozen {name}>"
25 # exec == Py_file_input
26 code = compile(text, filename, "exec", optimize=0, dont_inherit=True, module=name)
27 return marshal.dumps(code)
28
29
30def get_varname(name: str, prefix: str) -> str:

Callers 1

mainFunction · 0.85

Calls 2

compileFunction · 0.50
dumpsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…