def __setitem__(self, txn_key, value):
        """

        :param txn_key:
        :param value:
        :return:
        """
        assert type(txn_key) == tuple and len(txn_key) == 2

        txn, key = txn_key

        assert isinstance(txn, DbTransaction)
        assert key

        _key = struct.pack('>H', self._slot) + self._serialize_key(key)
        _data = self._serialize_value(value)

        if self._compress:
            _data = self._compress(_data)

        txn.put(_key, _data)

        for index in self._indexes:
            # FIXME: remove index entries for previous value

            # add index entries for new value
            _key = struct.pack('>H', index.pmap._slot) + index.pmap._serialize_key(index.fkey(value))
            _data = index.pmap._serialize_value(key)
            txn.put(_key, _data)

            print('DB INDEX PUT:', index, key, _key, _data)
def __setitem__ ( self , txn_key , value ) : assert type ( txn_key ) == tuple and len ( txn_key ) == 2 txn , key = txn_key assert isinstance ( txn , DbTransaction ) assert key _key = struct . pack ( '>H' , self . _slot ) + self . _serialize_key ( key ) _data = self . _serialize_value ( value ) if self . _compress : _data = self . _compress ( _data ) txn . put ( _key , _data ) for index in self . _indexes : _key = struct . pack ( '>H' , index . pmap . _slot ) + index . pmap . _serialize_key ( index . fkey ( value ) ) _data = index . pmap . _serialize_value ( key ) txn . put ( _key , _data ) print ( 'DB INDEX PUT:' , index , key , _key , _data )
:param txn_key:
        :param value:
        :return: