def if_not_read_only(f):
    """Raise TypeError if decortd function is called while read only is True."""

    def wrapper(*args):
        if args[0]._read_only:
            raise TypeError("This dictionary is read only!")
        return f(*args)

    return wrapper