metapython.core

Metapython syntax extensions

metapython.core.install_import_hook()
Installs the MetaImporter import hook along sys.meta_path
metapython.core.expand_file(fn)
Expand a MetaPython file
metapython.core.expand_string(text)
Expand MetaPython text
class metapython.core.MetaImporter

Bases: object

This is the class responsible for finding .mpy files to import

static find_module(fullname, path=None)
This method locates an .mpy file along either sys.path or the given path
class metapython.core.MetaLoader(path)

Bases: object

This is the class responsible for actually loading the .mpy files

load_module(name)
Load a .mpy file from the loader’s given path
class metapython.core.ImportContext(filename='<string>')

Bases: object

Provides a context to import MetaPython (including local & global dicts in which to exec the module code

expand(fn)
Token-based macro and code quoting expander
syntax_error(message, pos, line)
Helper to raise an appropriate syntax error

Previous topic

MetaPython Presentations

Next topic

metapython.parse

This Page