recursively convert a normal Mapping `d` and it's values to a specified type
    (defaults to AttrDict)

def convert_dict(d, cls=AttrDict): # not used
    '''
    recursively convert a normal Mapping `d` and it's values to a specified type
    (defaults to AttrDict)
    '''
    for k, v in d.items():
        if isinstance(v, Mapping):
            d[k] = convert_dict(v)
        elif isinstance(v, list):
            for i, e in enumerate(v):
                if isinstance(e, Mapping):
                    v[i] = convert_dict(e)
    return cls(d)