argmap.compile#
- argmap.compile(f)[source]#
Compile the decorated function.
Called once for a given decorated function – collects the code from all argmap decorators in the stack, and compiles the decorated function.
Much of the work done here uses the
assemble
method to allow recursive treatment of multiple argmap decorators on a single decorated function. That flattens the argmap decorators, collects the source code to construct a single decorated function, then compiles/executes/returns that function.The source code for the decorated function is stored as an attribute
_code
on the function object itself.Note that Python’s
compile
function requires a filename, but this code is constructed without a file, so a fictitious filename is used to describe where the function comes from. The name is something like: “argmap compilation 4”.- Parameters:
- fcallable
The function to be decorated
- Returns:
- funccallable
The decorated file