MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / deparse_code2str

Function deparse_code2str

uncompyle6/semantics/pysource.py:1459–1484  ·  view source on GitHub ↗

Return the deparsed text for a Python code object. `out` is where any intermediate output for assembly or tree output will be sent.

(
    code,
    out=sys.stdout,
    version=None,
    debug_opts=DEFAULT_DEBUG_OPTS,
    code_objects={},
    compile_mode="exec",
    is_pypy=IS_PYPY,
    walker=SourceWalker,
    start_offset: int = 0,
    stop_offset: int = -1,
)

Source from the content-addressed store, hash-verified

1457
1458
1459def deparse_code2str(
1460 code,
1461 out=sys.stdout,
1462 version=None,
1463 debug_opts=DEFAULT_DEBUG_OPTS,
1464 code_objects={},
1465 compile_mode="exec",
1466 is_pypy=IS_PYPY,
1467 walker=SourceWalker,
1468 start_offset: int = 0,
1469 stop_offset: int = -1,
1470) -> str:
1471 """
1472 Return the deparsed text for a Python code object. `out` is where
1473 any intermediate output for assembly or tree output will be sent.
1474 """
1475 return code_deparse(
1476 code,
1477 out,
1478 version,
1479 debug_opts,
1480 code_objects=code_objects,
1481 compile_mode=compile_mode,
1482 is_pypy=is_pypy,
1483 walker=walker,
1484 ).text
1485
1486
1487if __name__ == "__main__":

Callers 1

deparse_testFunction · 0.85

Calls 1

code_deparseFunction · 0.70

Tested by

no test coverage detected