Skip to main content
`Ctrl`+`K`

# argmap.assemble

argmap.assemble(f)

  Collects components of the source for the decorated function wrapping f.

  If `f` has multiple argmap decorators, we recursively assemble the stack of decorators into a single flattened function.

  This method is part of the `compile` method’s process yet separated from that method to allow recursive processing. The outputs are strings, dictionaries and lists that collect needed info to flatten any nested argmap-decoration.

  Parameters:
    f callable

      The function to be decorated. If f is argmapped, we assemble it.

  Returns:
    sig argmap.Signature

      The function signature as an `argmap.Signature` object.

    wrapped_name str

      The mangled name used to represent the wrapped function in the code being assembled.

    functions dict

      A dictionary mapping id(g) -> (mangled_name(g), g) for functions g referred to in the code being assembled. These need to be present in the `globals` scope of `exec` when defining the decorated function.

    mapblock list of lists and/or strings

      Code that implements mapping of parameters including any try blocks if needed. This code will precede the decorated function call.

    finallys list of lists and/or strings

      Code that implements the finally blocks to post-process the arguments (usually close any files if needed) after the decorated function is called.

    mutable_args bool

      True if the decorator needs to modify positional arguments via their indices. The compile method then turns the argument tuple into a list so that the arguments can be modified.