bundles / IPython 9.17.0 / IPython / core / compilerop / CachingCompiler / cache
function
IPython.core.compilerop:CachingCompiler.cache
Signature
def cache(self, transformed_code: str, number: int = 0, raw_code: str | None = None) → strSummary
Make a name for a block of code, and cache the code.
Parameters
transformed_code: strThe executable Python source code to cache and compile.
number: intA number which forms part of the code's name. Used for the execution counter.
raw_code: strThe raw code before transformation, if None, set to
transformed_code.
Returns
: The name of the cached code (as a string). Pass this as the filename: argument to compilation, so that tracebacks are correctly hooked up.
Aliases
IPython.core.compilerop.CachingCompiler.cache