You are viewing an older version (9.2.0).Go to latest (9.17.0)
{ } Raw JSON

bundles / IPython 9.2.0 / IPython / core / compilerop / CachingCompiler / cache

function

IPython.core.compilerop:CachingCompiler.cache

source: /dev/ipython/IPython/core/compilerop.py:134

Signature

def cache(self, transformed_code, number = 0, raw_code = None)

Summary

Make a name for a block of code, and cache the code.

Parameters

transformed_code : str

The executable Python source code to cache and compile.

number : int

A number which forms part of the code's name. Used for the execution counter.

raw_code : str

The 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