def discard(self, key):
    if (key in self.map):
        (key, prev, next) = self.map.pop(key)
        prev[NEXT] = next
        next[PREV] = prev
def discard(self, key):
    if (key in self.map):
        (key, prev, next) = self.map.pop(key)
        prev[NEXT] = next
        next[PREV] = prev