def make_read_only(o):
    """Makes objects read-only.

    Converts every `list` and `dict` into `ReadOnlyList` and `ReadOnlyDict` in
    a nested structure of `list`s, `dict`s and `tuple`s. Does not modify `o`
    but returns the converted structure.
    """
    if type(o) == dict:
        return ReadOnlyDict({k: make_read_only(v) for k, v in o.items()})
    elif type(o) == list:
        return ReadOnlyList([make_read_only(v) for v in o])
    elif type(o) == tuple:
        return tuple(map(make_read_only, o))
    else:
        return o
Makes objects read-only.

    Converts every `list` and `dict` into `ReadOnlyList` and `ReadOnlyDict` in
    a nested structure of `list`s, `dict`s and `tuple`s. Does not modify `o`
    but returns the converted structure.
    
sacred/config/custom_containers.py