'Create a template according to a dict (mapping). The
mapping\'s values should themselves either be Types or
convertible to Types.'

def __init__(self, mapping):

    subtemplates = {}
    for (key, typ) in mapping.items():
        subtemplates[key] = as_template(typ)
    self.subtemplates = subtemplates
