MCPcopy Index your code
hub / github.com/RustPython/RustPython / _recursive_replace

Method _recursive_replace

Lib/test/test_listcomps.py:664–669  ·  view source on GitHub ↗
(self, maybe_code)

Source from the content-addressed store, hash-verified

662 self._check_in_scopes(code, {"val": 0}, ns={"sys": sys})
663
664 def _recursive_replace(self, maybe_code):
665 if not isinstance(maybe_code, types.CodeType):
666 return maybe_code
667 return maybe_code.replace(co_consts=tuple(
668 self._recursive_replace(c) for c in maybe_code.co_consts
669 ))
670
671 def _replacing_exec(self, code_string, ns):
672 co = compile(code_string, "<string>", "exec")

Callers 1

_replacing_execMethod · 0.95

Calls 2

isinstanceFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected