def __setitem__(
        self,
        key: Union[int, slice],
        value: Union[BitVec, int, List[Union[int, BitVec]]],
    ):
        """

        :param key:
        :param value:
        """
        if isinstance(key, slice):
            start, step, stop = key.start, key.step, key.stop

            if start is None:
                start = 0
            if stop is None:
                raise IndexError("Invalid Memory Slice")
            if step is None:
                step = 1
            assert type(value) == list
            for i in range(0, stop - start, step):
                self[start + i] = cast(List[Union[int, BitVec]], value)[i]

        else:
            if isinstance(value, int):
                assert 0 <= value <= 0xFF
            if isinstance(value, BitVec):
                assert value.size() == 8
            self._memory[key] = cast(Union[int, BitVec], value)
def __setitem__ ( self , key : Union [ int , slice ] , value : Union [ BitVec , int , List [ Union [ int , BitVec ] ] ] , ) : if isinstance ( key , slice ) : start , step , stop = key . start , key . step , key . stop if start is None : start = 0 if stop is None : raise IndexError ( "Invalid Memory Slice" ) if step is None : step = 1 assert type ( value ) == list for i in range ( 0 , stop - start , step ) : self [ start + i ] = cast ( List [ Union [ int , BitVec ] ] , value ) [ i ] else : if isinstance ( value , int ) : assert 0 <= value <= 0xFF if isinstance ( value , BitVec ) : assert value . size ( ) == 8 self . _memory [ key ] = cast ( Union [ int , BitVec ] , value )
:param key:
        :param value: