'Removes book from self.cache, self.data and underlying database.'

def delete_book(self, id):

    try:
        self.cache.pop(self.index(id, cache=True))
        self.data.pop(self.index(id, cache=False))
    except TypeError:
        pass
    self.conn.execute('DELETE    FROM    books    WHERE    id=?', (id,))
    self.conn.commit()
